Ejemplo n.º 1
0
 def test_ctz11(self):
     tz = Tweet("@bob", 10, 32, "PM", "Mountain Time (US & Canada)", 11, 25,
                "Hi", "none")
     inEST = convert_time_zone(tz)
     self.assertEqual(tz.day, 26)
     self.assertEqual(tz.hour, 12)
     self.assertEqual(tz.period, "AM")
Ejemplo n.º 2
0
 def test_time45(self):  # This test should pass, and is meant to establish a baseline.
     tweet_1 = Tweet("@trapkingwillie", 12, 00, "PM", "€€€€€€€", 10, 15, "This should pass", "n/a")
     try:
         eastern_std_time = convert_time_zone(tweet_1)
     except CreateTweetError:
         pass
     else:
         self.fail("Did not raise CreateTweetError")
Ejemplo n.º 3
0
 def test_ctz11(
         self
 ):  # This test should pass, and is meant to establish a baseline.
     tweet_1 = Tweet("@bob", 12, 00, "PM", "Arizona", 10, 15,
                     "This should pass", "n/a")
     inEST = convert_time_zone(tweet_1)
     self.assertEqual(tweet_1.period, "PM")
     self.assertEqual(tweet_1.hour, 3)
Ejemplo n.º 4
0
 def test_time4(self):  # This test should raise a FilterError.
     tweet_4 = Tweet("@trapkingwillie", 1, 12, "PM", "Bern", 10, 15, "...this is dangerous", "n/a")
     eastern_std_time = convert_time_zone(tweet_4)
     self.assertEqual(tweet_4.period, "AM")
     self.assertEqual(tweet_4.hour, 7)
Ejemplo n.º 5
0
 def test_time3(self):  # This test should raise a FilterError.
     tweet_3 = Tweet("@trapkingwillie", 1, 00, "PM", "Darwin", 10, 15, "Why is Brendan coding?", "n/a")
     eastern_std_time = convert_time_zone(tweet_3)
     self.assertEqual(tweet_3.period, "PM")
     self.assertEqual(tweet_3.hour, 11)
Ejemplo n.º 6
0
 def test_time2A(self):  # This test should raise a FilterError.
     tweet_2 = Tweet("@trapkingwillie", 1, 12, "PM", "UTC", 11, 15, "Hope this works", "n/a")
     eastern_std_time = convert_time_zone(tweet_2)
     self.assertEqual(tweet_2.period, "AM")
     self.assertEqual(tweet_2.hour, 8)
Ejemplo n.º 7
0
 def test_time1(self):  # This test should pass, and is meant to establish a baseline.
     tweet_1 = Tweet("@trapkingwillie", 1, 12, "PM", "Copenhagen", 10, 15, "This should pass", "n/a")
     eastern_std_time = convert_time_zone(tweet_1)
     self.assertEqual(tweet_1.period, "AM")
     self.assertEqual(tweet_1.hour, 7)
Ejemplo n.º 8
0
 def test_time8(self):  # This test should pass, and is meant to establish a baseline.
     tweet_1 = Tweet("@trapkingwillie", 12, 00, "PM", "Mountain Time (US & Canada)", 10, 15, "This should pass", "n/a")
     eastern_std_time = convert_time_zone(tweet_1)
     self.assertEqual(tweet_1.period, "PM")
     self.assertEqual(tweet_1.hour, 2)
Ejemplo n.º 9
0
 def test_ctz3(self):
     tz = Tweet("@bob", 12, 32, "AM", "Pacific Time (US & Canada)", 10, 15,
                "Hi", "none")
     inEST = convert_time_zone(tz)
     self.assertEqual(tz.hour, 3)
     self.assertEqual(tz.period, "AM")
Ejemplo n.º 10
0
 def test_time37(self):  # This test should pass, and is meant to establish a baseline.
     tweet_1 = Tweet("@trapkingwillie", 12, 00, "PM", "Wellington", 10, 15, "This should pass", "n/a")
     eastern_std_time = convert_time_zone(tweet_1)
     self.assertEqual(tweet_1.period, "PM")
     self.assertEqual(tweet_1.hour-1, 6)
     self.assertEqual(tweet_1.day, 14)
Ejemplo n.º 11
0
 def test_time1(self):
     tweet_1 = Tweet("@trapkingwillie", 12, 00, "PM", "International Date Line West", 10, 15, "This should pass", "n/a")
     eastern_std_time = convert_time_zone(tweet_1)
     self.assertEqual(tweet_1.period, "PM")
     self.assertEqual(tweet_1.hour, 7)
Ejemplo n.º 12
0
 def test_time26(self):  # This test should pass, and is meant to establish a baseline.
     tweet_1 = Tweet("@trapkingwillie", 12, 00, "PM", "Kathmandu", 10, 15, "This should pass", "n/a")
     eastern_std_time = convert_time_zone(tweet_1)
     self.assertEqual(tweet_1.period, "AM")
     self.assertEqual(tweet_1.hour, 2)
     self.assertEqual(tweet_1.minute,15)
Ejemplo n.º 13
0
 def test_ctz8(self):
     tz = Tweet("@bob", 12, 32, "AM", "Central Time (US & Canada)", 11, 21,
                "Hi", "none")
     inEST = convert_time_zone(tz)
     self.assertEqual(tz.hour, 1)
     self.assertEqual(tz.period, "AM")
Ejemplo n.º 14
0
 def test_ctz4(self):
     tz = Tweet("@bob", 0, 32, "AM", "Eastern Time (US & Canada)", 10, 15,
                "Hi", "none")
     inEST = convert_time_zone(tz)
     self.assertEqual(tz.hour, 0)
     self.assertEqual(tz.period, "AM")
Ejemplo n.º 15
0
 def test_time5(self):  # This test should raise a FilterError.
     tweet_5 = Tweet("@trapkingwillie", 1, 12, "PM", "Fiji", 10, 15, "...tests for Harambe", "n/a")
     eastern_std_time = convert_time_zone(tweet_5)
     self.assertEqual(tweet_5.period, "PM")
     self.assertEqual(tweet_5.day, 14)
     self.assertEqual(tweet_5.hour, 9)
Ejemplo n.º 16
0
 def test_time6(self):  # This test should raise a FilterError.
     tweet_6 = Tweet("@trapkingwillie", 1, 12, "PM", "Nuku'alofa", 10, 15, "#Trump2016", "n/a")
     eastern_std_time = convert_time_zone(tweet_6)
     self.assertEqual(tweet_6.period, "PM")
     self.assertEqual(tweet_6.hour, 8)
Ejemplo n.º 17
0
 def test_time2(self):
     tweet_1 = Tweet("@trapkingwillie", 12, 00, "PM", "Midway Island", 10, 15, "This should pass", "n/a")
     eastern_std_time = convert_time_zone(tweet_1)
     self.assertEqual(tweet_1.period, "PM")
     self.assertEqual(tweet_1.hour, 7)