def test_adding_entry_points_affect_entry_point_map(easter_fixture):
easter_fixture.stub_egg.add_entry_point_from_line(easter_fixture.group_name,
'test1 = reahl.stubble_dev.test_easteregg:TestClass1')
easter_fixture.stub_egg.add_entry_point(easter_fixture.group_name, 'test2', TestClass2)
epmap = easter_fixture.stub_egg.get_entry_map()
assert list(epmap.keys()) == [easter_fixture.group_name]
name_to_entry_point = list(epmap.values())[0]
assert len(list(name_to_entry_point.keys())) == 2
assert isinstance(name_to_entry_point['test1'], pkg_resources.EntryPoint)
assert name_to_entry_point['test1'].load() is TestClass1
assert isinstance(name_to_entry_point['test2'], pkg_resources.EntryPoint)
assert name_to_entry_point['test2'].load() is TestClass2
easter_fixture.stub_egg.clear()
assert not easter_fixture.stub_egg.get_entry_map()
评论列表
文章目录