Пример #1
0
    def test_get_dependencies_removes_duplicates(self):
        bodies = ["Depends on #2", "", "depends on #3", "depends on #3"]

        root_id = '4'
        dependencies = get_dependencies_from_bodies(bodies, root_id)

        assert 2 == len(dependencies)
Пример #2
0
    def test_get_dependencies_identifiers_from_single_body(self):
        bodies = ["Depends on #2. Depends on #3"]

        dependencies = get_dependencies_from_bodies(bodies)

        assert 2 == len(dependencies)
        assert "2" in dependencies
        assert "3" in dependencies
Пример #3
0
    def test_get_dependencies_identifiers_from_list(self):
        bodies = ["Depends on #2", "", "depends on #3", "No dependencies here"]

        dependencies = get_dependencies_from_bodies(bodies)

        assert 2 == len(dependencies)
        assert "2" in dependencies
        assert "3" in dependencies
Пример #4
0
    def test_get_dependencies_identifiers_from_single_body(self):
        bodies = ["Depends on #2. Depends on #3"]

        root_id = '4'
        dependencies = get_dependencies_from_bodies(bodies, root_id)

        self.assertEqual(2, len(dependencies))
        self.assertIn("2", dependencies)
        self.assertIn("3", dependencies)
Пример #5
0
    def test_get_dependencies_accepts_external_dependencies(self):
        bodies = [
            "Depends on #2", "",
            "depends on alvarocavalcanti/my-dev-templates#1"
        ]
        dependencies = get_dependencies_from_bodies(bodies)

        assert 2 == len(dependencies)
        assert "2" in dependencies
        assert "alvarocavalcanti/my-dev-templates#1" in dependencies
Пример #6
0
    def test_get_dependencies_accepts_external_dependencies(self):
        bodies = [
            "Depends on #2", "",
            "depends on alvarocavalcanti/my-dev-templates#1"
        ]

        root_id = '4'
        dependencies = get_dependencies_from_bodies(bodies, root_id)

        self.assertEqual(2, len(dependencies))
        self.assertIn("2", dependencies)
        self.assertIn("alvarocavalcanti/my-dev-templates#1", dependencies)
Пример #7
0
    def test_get_dependencies_identifiers_from_list(self):
        bodies = [
            "Depends on #2", "", "depends on #3", "No dependencies here",
            "depends on #4"
        ]

        root_id = '4'
        dependencies = get_dependencies_from_bodies(bodies, root_id)

        self.assertEqual(2, len(dependencies))
        self.assertIn("2", dependencies)
        self.assertIn("3", dependencies)