def testCreateTestbedTrackerDefault(self):
     trackerConfig = TestbedTrackerConfiguration()
     
     self.assertEquals(32, trackerConfig.get_uprate())
     self.assertEquals(32, trackerConfig.get_downrate())
     self.assertEquals("http://localhost:8859/announce", trackerConfig.get_url())
     self.assertEquals(32768, trackerConfig.get_piece_length())
 def testCreateTestbedTrackerWithIncorrectURL(self):
     trackerConfig = TestbedTrackerConfiguration()
     correct_url = "http://localhost:8859/announce"
     self.assertEquals(correct_url, trackerConfig.get_url())
     # the following call should not change the URL, since it is not
     # compliant to the required URL pattern
     trackerConfig.set_url("http://lala/announce")
     self.assertEquals(correct_url, trackerConfig.get_url())
    def testCreateTestbedTracker(self):
        trackerConfig = TestbedTrackerConfiguration(
            64, 64, "http://localhost:8859/announce", 1000)

        self.assertEquals(64, trackerConfig.uprate)
        self.assertEquals(64, trackerConfig.downrate)
        self.assertEquals("http://localhost:8859/announce",
                          trackerConfig.get_url())
        self.assertEquals(1000, trackerConfig.get_piece_length())
 def testCreateTestbedTracker(self):
     trackerConfig = TestbedTrackerConfiguration(64, 
                                                 64, 
                                                 "http://localhost:8859/announce", 
                                                 1000)
     
     self.assertEquals(64, trackerConfig.uprate)
     self.assertEquals(64, trackerConfig.downrate)
     self.assertEquals("http://localhost:8859/announce", trackerConfig.get_url())
     self.assertEquals(1000, trackerConfig.get_piece_length())
Пример #5
0
 def __init__(self,
              uprate=None,
              downrate=None,
              url=None,
              pieceLength=None,
              hostname=None):
     TestbedTrackerConfiguration.__init__(self, uprate, downrate, url,
                                          pieceLength)
     self._hostname = hostname
     self._files = []
     self._waiting_time = 30
    def testAssertionErrorsOnInvalidArguments(self):
        conf = TestbedTrackerConfiguration()

        self.assertRaises(AssertionError, conf.set_uprate, -1)
        self.assertRaises(AssertionError, conf.set_downrate, -1)
        self.assertRaises(AssertionError, conf.set_url,
                          "http://localhost:1000/announce")
        self.assertRaises(AssertionError, conf.set_piece_length, 0)
 def testCreateTestbedTrackerWithCorrectURL(self):
     trackerConfig = TestbedTrackerConfiguration()
     self.assertEquals("http://localhost:8859/announce",
                       trackerConfig.get_url())
     new_url = "http://anything.com:8859/announce"
     trackerConfig.set_url(new_url)
     self.assertEquals(new_url, trackerConfig.get_url())
 def testCreateTestbedTrackerWithIncorrectURL(self):
     trackerConfig = TestbedTrackerConfiguration()
     correct_url = "http://localhost:8859/announce"
     self.assertEquals(correct_url, trackerConfig.get_url())
     # the following call should not change the URL, since it is not
     # compliant to the required URL pattern
     trackerConfig.set_url("http://lala/announce")
     self.assertEquals(correct_url, trackerConfig.get_url())
    def testCreateTestbedTrackerDefault(self):
        trackerConfig = TestbedTrackerConfiguration()

        self.assertEquals(32, trackerConfig.get_uprate())
        self.assertEquals(32, trackerConfig.get_downrate())
        self.assertEquals("http://localhost:8859/announce",
                          trackerConfig.get_url())
        self.assertEquals(32768, trackerConfig.get_piece_length())
 def __init__(self, uprate=None, downrate=None, url=None, pieceLength=None,
              hostname = None):
     TestbedTrackerConfiguration.__init__(self, uprate, downrate, url, pieceLength)
     self._hostname = hostname
     self._files = []
     self._waiting_time = 30
 def testCreateTestbedTrackerWithCorrectURL(self):
     trackerConfig = TestbedTrackerConfiguration()
     self.assertEquals("http://localhost:8859/announce", trackerConfig.get_url())
     new_url = "http://anything.com:8859/announce"
     trackerConfig.set_url(new_url)
     self.assertEquals(new_url, trackerConfig.get_url())