Beispiel #1
0
 def test_host(self):
     club = Venue("Berkeley City Club", "2315 Durant Avenue")
     rager = Performance("Nathan Trinkl's Birthday Bash",
                         datetime.datetime(18, 3, 16, 9, 55))
     self.assertTrue(rager not in club.events)
     club.host(rager)
     self.assertTrue(rager in club.events)
Beispiel #2
0
 def test_approve_for_not_hosted_event(self):
     club = Venue("Berkeley City Club", "2315 Durant Avenue")
     anant = Performer("Anant Sahai", 94704, "I reenact animes.")
     rager = Performance("Nathan Trinkl's Birthday Bash",
                         datetime.datetime(18, 3, 16, 9, 55))
     anant.apply_to(rager)
     with self.assertRaises(ValueError):
         club.approve(anant, rager)
Beispiel #3
0
 def test_host_overlapping_events(self):
     club = Venue("Berkeley City Club", "2315 Durant Avenue")
     rager = Performance("Steven Huangs's Birthday Bash",
                         datetime.datetime(18, 3, 16, 9, 45))
     rave = Performance("Japanese Pop Rave",
                        rager.start_time + datetime.timedelta(minutes=10))
     club.host(rager)
     with self.assertRaises(ValueError):
         club.host(rave)
Beispiel #4
0
 def test_approve(self):
     club = Venue("Berkeley City Club", "2315 Durant Avenue")
     anant = Performer("Anant Sahai", 94704, "I reenact animes.")
     rager = Performance("Nathan Trinkl's Birthday Bash",
                         datetime.datetime(18, 3, 16, 9, 55))
     club.host(rager)
     anant.apply_to(rager)
     self.assertTrue(anant not in rager.approved_performers)
     club.approve(anant, rager)
     self.assertTrue(anant in rager.approved_performers)
Beispiel #5
0
 def test_eq(self):
     club1 = Venue("Berkeley City Club", "2315 Durant Avenue")
     club2 = Venue("Berkeley City Club", "2315 Durant Avenue")
     self.assertEqual(club1, club2)
     hall = Venue("Carnegie Hall", "6124 Jefferson Street")
     self.assertNotEqual(club1, hall)
Beispiel #6
0
 def test_repr(self):
     club = Venue("Berkeley City Club", "2315 Durant Avenue")
     self.assertEqual(repr(club),
                      "Venue('Berkeley City Club', '2315 Durant Avenue')")
Beispiel #7
0
 def test_str(self):
     club = Venue("Berkeley City Club", "2315 Durant Avenue")
     self.assertEqual(str(club), "Berkeley City Club")
Beispiel #8
0
 def test_constructor(self):
     club = Venue("Berkeley City Club", "2315 Durant Avenue")
     self.assertTrue(club.name, "Berkeley City Club")
     self.assertTrue(club.address, "2315 Durant Avenue")