Guido Draheim avatar Guido Draheim committed 64edfb6

no assertTrue(expr) - use unittest assertOp

Comments (0)

Files changed (1)

src/tests/computer_test.py

         self.computer._localtime = time.localtime(1334887400)
     def test_01_options(self):
         self.assertEqual("plan4", self.computer.algorithm, )
-        self.assertTrue("3sat" in self.computer.rankup_channels)
+        self.assertIn("3sat", self.computer.rankup_channels)
         self.assertEqual(0.3, self.computer.rankup_value)
         self.assertEqual(0.5, self.computer.onlydate_rankup)
     def test_02_channels(self):
         channellist = [Channel("3sat",1),Channel("arte",0), Channel("arte",1)]
         self.computer.set_adapters_from_channels_list(channellist)
-        self.assertTrue(u"1" in self.computer.adapterlist())
+        self.assertIn(u"1", self.computer.adapterlist())
         self.assertEqual([u"1"], self.computer.adapters("3sat"))
         self.assertEqual([u"0", u"1"], self.computer.adapters("arte"))
     def test_03_entries(self):
     def test_20_2entries_differentchannels0(self):
         channellist = [Channel("3sat",0),Channel("arte",0), Channel("arte",1)]
         self.computer.set_adapters_from_channels_list(channellist)
-        self.assertTrue(u"1" in self.computer.adapterlist())
+        self.assertIn(u"1", self.computer.adapterlist())
         a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok",1)
         a2 = Entry("3sat","A2","22:33","23:33","0", "", "22.04.", "ok",1)
         req = Request(Locale("de"))
     def test_21_2entries_differentchannels1(self):
         channellist = [Channel("3sat",1),Channel("arte",0), Channel("arte",1)]
         self.computer.set_adapters_from_channels_list(channellist)
-        self.assertTrue(u"1" in self.computer.adapterlist())
+        self.assertIn(u"1", self.computer.adapterlist())
         a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok",1)
         a2 = Entry("3sat","A2","22:33","23:33","0", "", "22.04.", "ok",1)
         req = Request(Locale("de"))
     def test_23_3entries_differentchannels0(self):
         channellist = [Channel("3sat",0),Channel("arte",0), Channel("arte",1)]
         self.computer.set_adapters_from_channels_list(channellist)
-        self.assertTrue(u"1" in self.computer.adapterlist())
+        self.assertIn(u"1", self.computer.adapterlist())
         a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok",1)
         a2 = Entry("3sat","A2","22:33","23:33","0", "", "22.04.", "ok",1)
         a3 = Entry("3sat","A3","23:33","00:33","0", "", "22.04.", "ok",1)
     def test_24_3entries_differentchannels1(self):
         channellist = [Channel("3sat",1),Channel("arte",0), Channel("arte",1)]
         self.computer.set_adapters_from_channels_list(channellist)
-        self.assertTrue(u"1" in self.computer.adapterlist())
+        self.assertIn(u"1", self.computer.adapterlist())
         a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok",1)
         a2 = Entry("3sat","A2","22:33","23:33","0", "", "22.04.", "ok",1)
         a3 = Entry("3sat","A3","23:33","00:33","0", "", "22.04.", "ok",1)
     def test_25_3entries_differentchannels_inside1(self):
         channellist = [Channel("3sat",1),Channel("arte",0), Channel("arte",1)]
         self.computer.set_adapters_from_channels_list(channellist)
-        self.assertTrue(u"1" in self.computer.adapterlist())
+        self.assertIn(u"1", self.computer.adapterlist())
         a1 = Entry("3sat","A1","22:33","23:33","0", "", "22.04.", "ok",1)
         a2 = Entry("arte","A2","23:30","00:30","0", "", "22.04.", "ok",1)
         a3 = Entry("3sat","A3","23:33","00:33","0", "", "22.04.", "ok",1)
     def test_26_3entries_differentchannels_inside2(self):
         channellist = [Channel("3sat",1),Channel("arte",0), Channel("arte",1)]
         self.computer.set_adapters_from_channels_list(channellist)
-        self.assertTrue(u"1" in self.computer.adapterlist())
+        self.assertIn(u"1", self.computer.adapterlist())
         a1 = Entry("arte","A1","22:33","23:33","0", "", "22.04.", "ok",1)
         a2 = Entry("3sat","A2","23:30","00:30","0", "", "22.04.", "ok",1)
         a3 = Entry("arte","A3","23:33","00:33","0", "", "22.04.", "ok",1)
     def test_27_3entries_differentchannels_atend(self):
         channellist = [Channel("3sat",1),Channel("arte",0), Channel("arte",1)]
         self.computer.set_adapters_from_channels_list(channellist)
-        self.assertTrue(u"1" in self.computer.adapterlist())
+        self.assertIn(u"1", self.computer.adapterlist())
         a1 = Entry("arte","A1","22:33","23:33","0", "", "22.04.", "ok",1)
         a2 = Entry("arte","A2","23:33","00:33","0", "", "22.04.", "ok",1)
         a3 = Entry("3sat","A3","23:50","00:50","0", "", "22.04.", "ok",1)
     def test_28_3entries_differentchannels_nextday(self):
         channellist = [Channel("3sat",1),Channel("arte",0), Channel("arte",1)]
         self.computer.set_adapters_from_channels_list(channellist)
-        self.assertTrue(u"1" in self.computer.adapterlist())
+        self.assertIn(u"1", self.computer.adapterlist())
         a1 = Entry("arte","A1","22:33","23:33","0", "", "22.04.", "ok",1)
         a2 = Entry("arte","A2","23:33","00:33","0", "", "22.04.", "ok",1)
         a3 = Entry("3sat","A3","00:10","01:10","0", "", "23.04.", "ok",1)
     def test_40_4entries_samegroupandcontinue(self):
         channellist = [Channel("pro7",0),Channel("arte",0)]
         self.computer.set_adapters_from_channels_list(channellist)
-        self.assertTrue(u"1" not in self.computer.adapterlist())
+        self.assertNotIn(u"1", self.computer.adapterlist())
         a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok",1)
         a2 = Entry("arte","A2","23:30","00:30","3", "", "22.04.", "ok",1)
         a3 = Entry("arte","A3","00:30","01:10","3", "", "23.04.", "ok",1)
     def test_41_4entries_overlap1(self):
         channellist = [Channel("pro7",0),Channel("arte",0)]
         self.computer.set_adapters_from_channels_list(channellist)
-        self.assertTrue(u"1" not in self.computer.adapterlist())
+        self.assertNotIn(u"1", self.computer.adapterlist())
         a1 = Entry("pro7","A1","22:30","23:30","0", "", "22.04.", "ok",1)
         a2 = Entry("arte","A2","23:20","00:30","3", "", "22.04.", "ok",1)
         a3 = Entry("arte","A3","00:30","01:10","3", "", "23.04.", "ok",1)
     def test_42_4entries_overlap2(self):
         channellist = [Channel("pro7",0),Channel("arte",0)]
         self.computer.set_adapters_from_channels_list(channellist)
-        self.assertTrue(u"1" not in self.computer.adapterlist())
+        self.assertNotIn(u"1", self.computer.adapterlist())
         a1 = Entry("pro7","A1","22:30","00:40","0", "", "22.04.", "ok",1)
         a2 = Entry("arte","A2","23:20","00:30","3", "", "22.04.", "ok",1)
         a3 = Entry("arte","A3","00:30","01:10","3", "", "23.04.", "ok",1)
     def test_43_4entries_delete_start1(self): 
         channellist = [Channel("pro7",0),Channel("arte",0)]
         self.computer.set_adapters_from_channels_list(channellist)
-        self.assertTrue(u"1" not in self.computer.adapterlist())
+        self.assertNotIn(u"1", self.computer.adapterlist())
         a1 = Entry("pro7","A1","23:20","23:40","0", "", "22.04.", "ok",1)
         a2 = Entry("arte","A2","23:20","00:30","3", "", "22.04.", "ok",1)
         a3 = Entry("arte","A3","00:30","01:10","3", "", "23.04.", "ok",1)
     def test_44_4entries_delete_start2(self): 
         channellist = [Channel("pro7",0),Channel("arte",0)]
         self.computer.set_adapters_from_channels_list(channellist)
-        self.assertTrue(u"1" not in self.computer.adapterlist())
+        self.assertNotIn(u"1", self.computer.adapterlist())
         a1 = Entry("pro7","A1","23:20","00:40","0", "", "22.04.", "ok",1)
         a2 = Entry("arte","A2","23:20","00:30","3", "", "22.04.", "ok",1)
         a3 = Entry("arte","A3","00:30","01:10","3", "", "23.04.", "ok",1)
     def test_45_4entries_delete_inside1(self):
         channellist = [Channel("pro7",0),Channel("arte",0)]
         self.computer.set_adapters_from_channels_list(channellist)
-        self.assertTrue(u"1" not in self.computer.adapterlist())
+        self.assertNotIn(u"1", self.computer.adapterlist())
         a1 = Entry("arte","A1","23:20","00:30","3", "", "22.04.", "ok",1)
         a2 = Entry("pro7","A2","23:40","00:20","0", "", "22.04.", "ok",1)
         a3 = Entry("arte","A3","00:30","01:10","3", "", "23.04.", "ok",1)
     def test_46_4entries_delete2_inside1(self): 
         channellist = [Channel("pro7",0),Channel("arte",0),Channel("3sat",0)]
         self.computer.set_adapters_from_channels_list(channellist)
-        self.assertTrue(u"1" not in self.computer.adapterlist())
+        self.assertNotIn(u"1", self.computer.adapterlist())
         a1 = Entry("arte","A1","23:20","00:30","3", "", "22.04.", "ok",1)
         a2 = Entry("pro7","A2","23:40","00:20","0", "", "22.04.", "ok",1)
         a3 = Entry("3sat","A3","00:10","01:10","3", "", "23.04.", "ok",1)
         _logg.error(" FIXME all wrong ")
         channellist = [Channel("pro7",0),Channel("arte",0),Channel("3sat",0)]
         self.computer.set_adapters_from_channels_list(channellist)
-        self.assertTrue(u"1" not in self.computer.adapterlist())
+        self.assertNotIn(u"1", self.computer.adapterlist())
         a1 = Entry("arte","A1","23:20","00:30","3", "", "22.04.", "ok",1)
         a2 = Entry("pro7","A2","23:40","00:20","0", "", "22.04.", "ok",1)
         a3 = Entry("3sat","A3","23:40","01:10","3", "", "22.04.", "ok",1)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.