示例#1
0
    def test_check_in_and_undo_check_in(self):
        timezone = challonge.get_timezone()
        # Get the local time plus 30 minutes.
        test_date = datetime.datetime.now(tz=timezone) + datetime.timedelta(minutes=30)

        challonge.tournaments.update(
            self.t["id"],
            check_in_duration=30,
            start_at=test_date)

        challonge.participants.check_in(self.t["id"], self.ps[0]["id"])
        challonge.participants.check_in(self.t["id"], self.ps[1]["id"])

        p1 = challonge.participants.show(self.t["id"], self.ps[0]["id"])
        p2 = challonge.participants.show(self.t["id"], self.ps[1]["id"])

        self.assertTrue(p1["checked_in"])
        self.assertTrue(p2["checked_in"])

        # check the undo process
        challonge.participants.undo_check_in(self.t["id"], self.ps[0]["id"])
        challonge.participants.undo_check_in(self.t["id"], self.ps[0]["id"])

        p1 = challonge.participants.show(self.t["id"], self.ps[0]["id"])
        p2 = challonge.participants.show(self.t["id"], self.ps[0]["id"])

        self.assertFalse(p1["checked_in"])
        self.assertFalse(p2["checked_in"])
示例#2
0
    def test_check_in_and_undo_check_in(self):
        timezone = challonge.get_timezone()
        # Get the local time plus 30 minutes.
        test_date = datetime.datetime.now(tz=timezone) + datetime.timedelta(minutes=30)

        challonge.tournaments.update(
            self.t["id"],
            check_in_duration=30,
            start_at=test_date)

        challonge.participants.check_in(self.t["id"], self.ps[0]["id"])
        challonge.participants.check_in(self.t["id"], self.ps[1]["id"])

        p1 = challonge.participants.show(self.t["id"], self.ps[0]["id"])
        p2 = challonge.participants.show(self.t["id"], self.ps[1]["id"])

        self.assertTrue(p1["checked_in"])
        self.assertTrue(p2["checked_in"])

        # # check the undo process
        challonge.participants.undo_check_in(self.t["id"], self.ps[0]["id"])
        challonge.participants.undo_check_in(self.t["id"], self.ps[0]["id"])

        p1 = challonge.participants.show(self.t["id"], self.ps[0]["id"])
        p2 = challonge.participants.show(self.t["id"], self.ps[0]["id"])

        self.assertFalse(p1["checked_in"])
        self.assertFalse(p2["checked_in"])
示例#3
0
 def test_set_get_timezone(self):
     test_tz = 'Asia/Seoul'
     challonge.set_timezone(test_tz)
     tz = challonge.get_timezone()
     self.assertEqual(str(tz), test_tz)
示例#4
0
 def test_get_local_timezone(self):
     tz = challonge.get_timezone()
     local_tz = tzlocal.get_localzone()
     self.assertEqual(tz, local_tz)
示例#5
0
 def test_set_get_timezone(self):
     test_tz = 'Asia/Seoul'
     challonge.set_timezone(test_tz)
     tz = challonge.get_timezone()
     self.assertEqual(str(tz), test_tz)
示例#6
0
 def test_get_local_timezone(self):
     tz = challonge.get_timezone()
     local_tz = tzlocal.get_localzone()
     self.assertEqual(tz, local_tz)