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