예제 #1
0
 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>")
예제 #2
0
 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")
예제 #3
0
 def test_get(self):
     self.assertEqual(FDI().get("title"), "Title")