Esempio n. 1
0
    def test_add_group(self):
        groups = ImportGroups()

        with self.assertRaises(ValueError):
            groups.add_group({})

        with self.assertRaises(ValueError):
            groups.add_group({"type": "foo"})

        groups.add_group({"type": "stdlib"})

        self.assertEqual(len(groups), 1)
        self.assertEqual(groups[0].__class__, StdLibGroup)
Esempio n. 2
0
    def test_add_group(self):
        groups = ImportGroups()

        with self.assertRaises(ValueError):
            groups.add_group({})

        with self.assertRaises(ValueError):
            groups.add_group({'type': 'foo'})

        groups.add_group({'type': 'stdlib'})

        self.assertEqual(len(groups.groups), 1)
        self.assertEqual(groups.groups[0].__class__, StdLibGroup)
Esempio n. 3
0
    def test_add_group(self):
        groups = ImportGroups()

        with self.assertRaises(ValueError):
            groups.add_group({})

        with self.assertRaises(ValueError):
            groups.add_group({"type": "foo"})

        groups.add_group({"type": "stdlib"})

        self.assertEqual(len(groups), 1)
        self.assertEqual(groups[0].__class__, StdLibGroup)