def test_call(self): self.assertEqual(FDI()("title"), "Title") self.assertEqual(FDI()("~title~artist"), "Title - Artist") self.assertEqual(FDI(title="foo")("title"), "foo") self.assertEqual(FDI(title="f")("~title~artist"), "f - Artist") self.assertEqual(FDI()("~#rating"), "Rating") self.assertEqual(FDI({"~#rating": 0.5})("~#rating"), 0.5) self.assertEqual(FDI()("~#rating:max"), "Rating<max>")
def test_comma(self): self.assertEqual(FDI().comma("title"), "Title") self.assertEqual(FDI({"~#rating": 0.5}).comma("~#rating"), 0.5) self.assertEqual(FDI(title="a\nb").comma("title"), "a, b")
def test_get(self): self.assertEqual(FDI().get("title"), "Title")