Beispiel #1
0
    def test_timezones(self):
        # Make sure all_timezones() matches pytz's versions
        all_timezones = when.all_timezones()
        self.assertEqual(all_timezones, pytz.all_timezones)
        all_timezones_set = when.all_timezones_set()
        self.assertEqual(all_timezones_set, pytz.all_timezones_set)

        # Make sure common_timezones() matches pytz's versions
        common_timezones = when.common_timezones()
        self.assertEqual(common_timezones, pytz.common_timezones)
        common_timezones_set = when.common_timezones_set()
        self.assertEqual(common_timezones_set, pytz.common_timezones_set)

def QuickSearch():
    call = 'n'
    i = 0
    found = False
    for t in timezones:
        check_time = pendulum.now(t)
        if( check_time.minute == minute and check_time.hour == hour):
                i += 1
                print("Hit #{}: {}".format(i, t))
                found = True

    if(found == False):
        call = input("Unable to find the specific local time, do you want to continue with deep search? Y/N?")

    if(call == 'y' or call == 'Y'):
        DeepSearch()


timezones = when.all_timezones()
choice = int(input("1. Quick search (Searches for timezone based on accurate timing of minutes & hours)\n"
               "2. Deep search (Searches for timezones which are near requested local time"))
if(choice == 1):
    QuickSearch()
elif(choice == 2):
    DeepSearch()
else:
    print("Unknown command received!")

Beispiel #3
0
 def test_all_timezones(self):
     """Test when.all_timezones()"""
     # Make sure all_timezones() matches pytz's version
     all_timezones = when.all_timezones()
     self.assertEqual(all_timezones, pytz.all_timezones)
Beispiel #4
0
 def test_all_timezones(self):
     """Test when.all_timezones()"""
     # Make sure all_timezones() matches pytz's version
     all_timezones = when.all_timezones()
     self.assertEqual(all_timezones, pytz.all_timezones)