Пример #1
0
    def test_sorted_attributes_base(self):
        """Sorted attributes - basic sanity checks"""
        attrs = depsort_attributes([], self.deps)
        self.assertListEqual(attrs, [])

        attrs = depsort_attributes(["a"], self.deps)
        self.assertListEqual(attrs, ["a"])
Пример #2
0
    def test_sorted_attributes_base(self):
        """Sorted attributes - basic sanity checks"""
        attrs = depsort_attributes([], self.deps)
        self.assertListEqual(attrs, [])

        attrs = depsort_attributes(["a"], self.deps)
        self.assertListEqual(attrs, ["a"])
Пример #3
0
    def test_sorted_circular(self):
        with self.assertRaisesRegex(ExpressionError, "Circular"):
            depsort_attributes(["loop1", "loop2"], self.deps)

        with self.assertRaisesRegex(ExpressionError, "Circular"):
            depsort_attributes(
                ["indirect_loop1", "intermediate", "indirect_loop2"],
                self.deps)
Пример #4
0
 def test_sorted_unknown(self):
     with self.assertRaisesRegex(ExpressionError, "Unknown"):
         attrs = depsort_attributes(["c", "b"], {})
Пример #5
0
 def test_sorted_attributes(self):
     attrs = depsort_attributes(["c", "b", "a"], self.deps)
     self.assertListEqual(attrs, ["a", "b", "c"])
Пример #6
0
    def test_sorted_circular(self):
        with self.assertRaisesRegex(ExpressionError, "Circular"):
            depsort_attributes(["loop1", "loop2"], self.deps)

        with self.assertRaisesRegex(ExpressionError, "Circular"):
            depsort_attributes(["indirect_loop1", "intermediate", "indirect_loop2"], self.deps)
Пример #7
0
 def test_sorted_unknown(self):
     with self.assertRaisesRegex(ExpressionError, "Unknown"):
         attrs = depsort_attributes(["c", "b"], {})
Пример #8
0
 def test_sorted_attributes(self):
     attrs = depsort_attributes(["c", "b", "a"], self.deps)
     self.assertListEqual(attrs, ["a", "b", "c"])