Example #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"])
Example #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"])
Example #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)
Example #4
0
 def test_sorted_unknown(self):
     with self.assertRaisesRegex(ExpressionError, "Unknown"):
         attrs = depsort_attributes(["c", "b"], {})
Example #5
0
 def test_sorted_attributes(self):
     attrs = depsort_attributes(["c", "b", "a"], self.deps)
     self.assertListEqual(attrs, ["a", "b", "c"])
Example #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)
Example #7
0
 def test_sorted_unknown(self):
     with self.assertRaisesRegex(ExpressionError, "Unknown"):
         attrs = depsort_attributes(["c", "b"], {})
Example #8
0
 def test_sorted_attributes(self):
     attrs = depsort_attributes(["c", "b", "a"], self.deps)
     self.assertListEqual(attrs, ["a", "b", "c"])