def test_init(self): config = {'packages': []} group = PackagesGroup(config) self.assertDictEqual(group.config, config) with self.assertRaises(ValueError): PackagesGroup()
def test_should_add_statement(self): config = {'packages': ['a']} group = PackagesGroup(config) self.assertTrue(group.should_add_statement(ImportStatement([], 'a'))) self.assertFalse(group.should_add_statement(ImportStatement([], 'b')))
def test_should_add_statement(self): config = {"packages": ["a"]} group = PackagesGroup(config) self.assertTrue(group.should_add_statement(ImportStatement([], "a"))) self.assertFalse(group.should_add_statement(ImportStatement([], "b")))