コード例 #1
0
ファイル: test_pyglet2d.py プロジェクト: hsharrison/pyglet2d
def test_regular_polygon_from_dict():
    spec = {
        'center': [0, 0],
        'radius': 1,
        'n_vertices': 10,
    }
    assert Shape.from_dict(spec) == Shape.regular_polygon([0, 0], 1, 10)
コード例 #2
0
ファイル: test_pyglet2d.py プロジェクト: EidurMoller/pyglet2d
def test_regular_polygon_from_dict():
    spec = {
        'center': [0, 0],
        'radius': 1,
        'n_vertices': 10,
    }
    assert Shape.from_dict(spec) == Shape.regular_polygon([0, 0], 1, 10)
コード例 #3
0
ファイル: test_pyglet2d.py プロジェクト: EidurMoller/pyglet2d
def test_from_dict():
    spec = {
        'vertices': [[1, 0], [0, 1], [-1, 0], [0, -1]],
        'color': (120, 50, 12),
        'velocity': np.random.sample(2),
    }
    assert Shape.from_dict(spec) == Shape(spec['vertices'],
                                          color=spec['color'],
                                          velocity=spec['velocity'])
コード例 #4
0
ファイル: test_pyglet2d.py プロジェクト: hsharrison/pyglet2d
def test_from_dict():
    spec = {
        'vertices': [[1, 0],
                     [0, 1],
                     [-1, 0],
                     [0, -1]],
        'color': (120, 50, 12),
        'velocity': np.random.sample(2),
    }
    assert Shape.from_dict(spec) == Shape(spec['vertices'], color=spec['color'], velocity=spec['velocity'])
コード例 #5
0
ファイル: test_pyglet2d.py プロジェクト: hsharrison/pyglet2d
def test_rectangle_from_dict():
    spec = {
        'vertices': [[-1, -1],
                     [1, 1]],
    }
    assert Shape.from_dict(spec) == Shape.rectangle(spec['vertices'])
コード例 #6
0
ファイル: test_pyglet2d.py プロジェクト: hsharrison/pyglet2d
def test_circle_from_dict():
    spec = {
        'center': [0, 0],
        'radius': 1,
    }
    assert Shape.from_dict(spec) == Shape.circle([0, 0], 1)
コード例 #7
0
ファイル: test_pyglet2d.py プロジェクト: EidurMoller/pyglet2d
def test_rectangle_from_dict():
    spec = {
        'vertices': [[-1, -1], [1, 1]],
    }
    assert Shape.from_dict(spec) == Shape.rectangle(spec['vertices'])
コード例 #8
0
ファイル: test_pyglet2d.py プロジェクト: EidurMoller/pyglet2d
def test_circle_from_dict():
    spec = {
        'center': [0, 0],
        'radius': 1,
    }
    assert Shape.from_dict(spec) == Shape.circle([0, 0], 1)