def test_recordsWrites(self, resetMachine, tenPixelStrand):
    delayTime = 300
    tenPixelStrand.fill(green)
    tenPixelStrand.write()
    time.sleep((delayTime / 1000))
    tenPixelStrand.fill(red)
    tenPixelStrand.write()
    writeHistory = tenPixelStrand.writesForTesting
    assert (len(writeHistory) == 2)
    assert _allPixelsAreColor(writeHistory[0], green)
    assert (writeHistory[0].timeFromFirstWrite == 0)
    assert _allPixelsAreColor(writeHistory[1], red)
    assert (_approximately(writeHistory[1].timeFromFirstWrite) == delayTime)
def test_recordsWrites(self, resetMachine, tenPixelStrand):
    delayTime = 300
    tenPixelStrand.fill(green)
    tenPixelStrand.write()
    time.sleep((delayTime / 1000))
    tenPixelStrand.fill(red)
    tenPixelStrand.write()
    writeHistory = tenPixelStrand.writesForTesting
    assert (len(writeHistory) == 2)
    assert _allPixelsAreColor(writeHistory[0], green)
    assert (writeHistory[0].timeFromFirstWrite == 0)
    assert _allPixelsAreColor(writeHistory[1], red)
    assert (_approximately(writeHistory[1].timeFromFirstWrite) == delayTime)