Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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')")
Ejemplo n.º 7
0
 def test_str(self):
     club = Venue("Berkeley City Club", "2315 Durant Avenue")
     self.assertEqual(str(club), "Berkeley City Club")
Ejemplo n.º 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")