def test_draw(self): csource = graph.ColourGradient((1, 1, 1), (0, 0, 0)) p = graph.Dense(csource, 20, graph.rgb("ffffff"), graph.rgb("000000"), False) l = range(8) l.reverse() track = sortable.TrackList(l) a = algos.insertionsort.insertionsort(track) p.draw(track, "test", os.path.join(OUTDIR, "test_weave.png"))
def test_lineCoords(self): csource = graph.ColourGradient((1, 1, 1), (0, 0, 0)) p = graph.Weave(csource, 100, 100, 20, graph.rgb("ffffff"), graph.rgb("000000"), False, 6, 1) r = p.lineCoords([1, 2, 3, 4, 5], 5, 0.02) assert r[-1] == (1, 1) # Lead-in assert r[0][1] == r[1][1] assert r[0][0] != r[1][0] # Lead-out assert r[-1][1] == r[-2][1] assert r[-1][0] != r[-2][0]
def test_lineCoords(self): csource = graph.ColourGradient((1, 1, 1), (0, 0, 0)) p = graph.Weave( csource, 100, 100, 20, graph.rgb("ffffff"), graph.rgb("000000"), False, 6, 1 ) r = p.lineCoords([1, 2, 3, 4, 5], 5, 0.02) assert r[-1] == (1, 1) # Lead-in assert r[0][1] == r[1][1] assert r[0][0] != r[1][0] # Lead-out assert r[-1][1] == r[-2][1] assert r[-1][0] != r[-2][0]
def test_rgb(self): assert graph.rgb((255, 255, 255)) == (1, 1, 1) assert graph.rgb("ffffff") == (1, 1, 1) assert graph.rgb("000000") == (0, 0, 0)