def test_connectmethod(self):
    speedify.connect_closest()
    speedify.connectmethod('private', 'jp')
    cm_settings = speedify.show_connectmethod()
    self.assertEqual(cm_settings['connectMethod'], 'private')
    self.assertEqual(cm_settings['country'], '')
    self.assertEqual(cm_settings['num'], 0)
    self.assertEqual(cm_settings['city'], '')
    speedify.connectmethod('p2p')
    cm_settings = speedify.show_connectmethod()
    self.assertEqual(cm_settings['connectMethod'], 'p2p')
    self.assertEqual(cm_settings['country'], '')
    self.assertEqual(cm_settings['num'], 0)
    self.assertEqual(cm_settings['city'], '')
    retval = speedify.connectmethod('country', country='sg')
    cm_settings = speedify.show_connectmethod()
    self.assertEqual(cm_settings['connectMethod'], 'country')
    self.assertEqual(cm_settings['country'], 'sg')
    self.assertEqual(cm_settings['connectMethod'], retval['connectMethod'])
    self.assertEqual(cm_settings['country'], retval['country'])
    self.assertEqual(cm_settings['num'], retval['num'])
    self.assertEqual(cm_settings['city'], retval['city'])
    speedify.connectmethod('closest')
    cm_settings = speedify.show_connectmethod()
    self.assertEqual(cm_settings['connectMethod'], 'closest')
    self.assertEqual(cm_settings['country'], '')
    self.assertEqual(cm_settings['num'], 0)
    self.assertEqual(cm_settings['city'], '')
def test_connectmethod(self):
    speedify.connect_closest()
    speedify.connectmethod('private', 'jp')
    cm_settings = speedify.show_connectmethod()
    self.assertEqual(cm_settings['connectMethod'], 'private')
    self.assertEqual(cm_settings['country'], )
    self.assertEqual(cm_settings['num'], 0)
    self.assertEqual(cm_settings['city'], )
    speedify.connectmethod('p2p')
    cm_settings = speedify.show_connectmethod()
    self.assertEqual(cm_settings['connectMethod'], 'p2p')
    self.assertEqual(cm_settings['country'], )
    self.assertEqual(cm_settings['num'], 0)
    self.assertEqual(cm_settings['city'], )
    retval = speedify.connectmethod('country', country='sg')
    cm_settings = speedify.show_connectmethod()
    self.assertEqual(cm_settings['connectMethod'], 'country')
    self.assertEqual(cm_settings['country'], 'sg')
    self.assertEqual(cm_settings['connectMethod'], retval['connectMethod'])
    self.assertEqual(cm_settings['country'], retval['country'])
    self.assertEqual(cm_settings['num'], retval['num'])
    self.assertEqual(cm_settings['city'], retval['city'])
    speedify.connectmethod('closest')
    cm_settings = speedify.show_connectmethod()
    self.assertEqual(cm_settings['connectMethod'], 'closest')
    self.assertEqual(cm_settings['country'], )
    self.assertEqual(cm_settings['num'], 0)
    self.assertEqual(cm_settings['city'], )