Example #1
0
    def test_init(self):
        config = {'packages': []}
        group = PackagesGroup(config)
        self.assertDictEqual(group.config, config)

        with self.assertRaises(ValueError):
            PackagesGroup()
Example #2
0
    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')))
Example #3
0
    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")))
Example #4
0
    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")))