Exemplo n.º 1
0
 def test_constructs_ancestors(self):
     fm = FixturesManager()
     fm.load(
         './charlatan/tests/data/dependencies.yaml'
     )
     assert not fm.cache
     # loading fixture3 should load fixture1 and fixture2 also
     fm.get_fixture('fixture3')
     self.assertIn('fixture1', fm.cache)
     self.assertIn('fixture4', fm.cache)
Exemplo n.º 2
0
 def test_constructs_ancestors(self):
     fm = FixturesManager()
     fm.load(
         './charlatan/tests/data/dependencies.yaml'
     )
     assert not fm.cache
     # loading fixture3 should load fixture1 and fixture2 also
     fm.get_fixture('fixture3')
     self.assertIn('fixture1', fm.cache)
     self.assertIn('fixture4', fm.cache)
Exemplo n.º 3
0
def test_custom_builder():
    manager = FixturesManager(get_builder=DictBuilder())
    manager.load('./charlatan/tests/example/data/custom_builder.yaml')
    assert manager.get_fixture('toaster').slots == 3
Exemplo n.º 4
0
def test_deep_inherit():
    manager = FixturesManager()
    manager.load('./charlatan/tests/example/data/deep_inherit.yaml')
    toaster2 = manager.get_fixture('toaster2')
    assert toaster2['toasts']['toast1']['price'] == 10
    assert toaster2['toasts']['toast1']['weight'] == 20
def test_custom_builder():
    manager = FixturesManager(get_builder=DictBuilder())
    manager.load('./charlatan/tests/example/data/custom_builder.yaml')
    assert manager.get_fixture('toaster').slots == 3