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