def test_signature_port(self): ''' Should generate a correct signature with a non-standard port. ''' tc = create_test_tc({'resource_link_id': 1}) def test_url(url, sig): tc.launch_url = url ld = tc.generate_launch_data() self.assertNotEqual(ld, None) self.assertEquals(ld['oauth_signature'], sig) test_url('http://dr-chuck.com:123/ims/php-simple/tool.php', 'GBdmYAMU9noJKLZpv2BPnEN6rkY=') test_url('http://dr-chuck.com/ims/php-simple/tool.php', 'Kctk9REY2GcDk0NQl+RvOcVOYC4=') test_url('http://dr-chuck.com:80/ims/php-simple/tool.php', 'Kctk9REY2GcDk0NQl+RvOcVOYC4=') test_url('http://dr-chuck.com:443/ims/php-simple/tool.php', '3jQGMDmrPlrrzckFu7M9QClFcjU=') test_url('https://dr-chuck.com/ims/php-simple/tool.php', 'KLd5hidxIMdN5b4nmmCYLTQuq/o=') test_url('https://dr-chuck.com:443/ims/php-simple/tool.php', 'KLd5hidxIMdN5b4nmmCYLTQuq/o=') test_url('https://dr-chuck.com:80/ims/php-simple/tool.php', 'bbd6hYAvQYW/5UZu1+/DvMXwvGk=') test_url('https://dr-chuck.com:80/ims/php-simple/tool.php?oi=hoyt', 'xj+c/6OnADlWa5w1QLFTgOE1Mkk=')
def test_signature_port(self): ''' Should generate a correct signature with a non-standard port. ''' tc = create_test_tc({'resource_link_id': 1}) def test_url(url, sig): tc.launch_url = url ld = tc.generate_launch_data() self.assertNotEqual(ld, None) self.assertEquals(ld['oauth_signature'], sig) test_url('http://dr-chuck.com:123/ims/php-simple/tool.php', 'I2zrOsXkLvBMbb5HzRXZrZAQVOg=') test_url('http://dr-chuck.com/ims/php-simple/tool.php', 'L3VZIDWMLqBVqkGqpBLSjems/QY=') test_url('http://dr-chuck.com:80/ims/php-simple/tool.php', 'L3VZIDWMLqBVqkGqpBLSjems/QY=') test_url('http://dr-chuck.com:443/ims/php-simple/tool.php', 'NCkKyc8X+XbULcVTuHagTATxcLM=') test_url('https://dr-chuck.com/ims/php-simple/tool.php', 'hjIv46SZHK8hEBF0n79Z8al47Oo=') test_url('https://dr-chuck.com:443/ims/php-simple/tool.php', 'hjIv46SZHK8hEBF0n79Z8al47Oo=') test_url('https://dr-chuck.com:80/ims/php-simple/tool.php', '94N4Am1bvyInWNXM4WSNyoOMmUc=') test_url('https://dr-chuck.com:80/ims/php-simple/tool.php?oi=hoyt', 'g724Rvpu1fC/kkb6sZEmzScUcLg=')
def test_signature_port(self): ''' Should generate a correct signature with a non-standard port. ''' tc = create_test_tc({'resource_link_id': 1}) def test_url(url, sig): tc.launch_url = url ld = tc.generate_launch_data() self.assertNotEqual(ld, None) self.assertEqual(ld['oauth_signature'], sig) test_url('http://dr-chuck.com:123/ims/php-simple/tool.php', 'I2zrOsXkLvBMbb5HzRXZrZAQVOg=') test_url('http://dr-chuck.com/ims/php-simple/tool.php', 'L3VZIDWMLqBVqkGqpBLSjems/QY=') test_url('http://dr-chuck.com:80/ims/php-simple/tool.php', 'L3VZIDWMLqBVqkGqpBLSjems/QY=') test_url('http://dr-chuck.com:443/ims/php-simple/tool.php', 'NCkKyc8X+XbULcVTuHagTATxcLM=') test_url('https://dr-chuck.com/ims/php-simple/tool.php', 'hjIv46SZHK8hEBF0n79Z8al47Oo=') test_url('https://dr-chuck.com:443/ims/php-simple/tool.php', 'hjIv46SZHK8hEBF0n79Z8al47Oo=') test_url('https://dr-chuck.com:80/ims/php-simple/tool.php', '94N4Am1bvyInWNXM4WSNyoOMmUc=') test_url('https://dr-chuck.com:80/ims/php-simple/tool.php?oi=hoyt', 'g724Rvpu1fC/kkb6sZEmzScUcLg=')
def test_signature(self): ''' Should generate correct oauth signature. ''' tc = create_test_tc() result = tc.generate_launch_data() self.assertNotEqual(result, None) self.assertEqual(result['oauth_signature'], 'o8Oh2XbGx5Wa1yvcEdsdOydoYV4=')
def test_signature(self): ''' Should generate correct oauth signature. ''' tc = create_test_tc() result = tc.generate_launch_data() self.assertNotEqual(result, None) self.assertEqual(result['oauth_signature'], 'ZXogq5KUR0ukZijtSjt4qh/S4Vc=')
def test_signature(self): ''' Should generate correct oauth signature. ''' tc = create_test_tc() result = tc.generate_launch_data() self.assertNotEqual(result, None) self.assertEqual(result['oauth_signature'], 'Ni3UTet25Mx9fjChugHCs/5ZaVk=')
def test_url_query_parameters(self): ''' Should generate a correct signature with URL query parameters. ''' tc = create_test_tc() tc.launch_url = 'http://dr-chuck.com/ims/php-simple/tool.php?a=1&b=2&c=3%20%26a' result = tc.generate_launch_data() self.assertNotEqual(result, None) self.assertEquals(result['oauth_signature'], 'kiObbrNVu4vHzd0+yVDHvrsvegQ=') self.assertEquals(result['c'], '3 &a')
def test_url_query_parameters(self): ''' Should generate a correct signature with URL query parameters. ''' tc = create_test_tc() tc.launch_url = 'http://dr-chuck.com/ims/php-simple/tool.php?a=1&b=2&c=3%20%26a' result = tc.generate_launch_data() self.assertNotEqual(result, None) self.assertEquals(result['oauth_signature'], 'lpi9xKVVXZB6xewfh/PUeasHiwU=') self.assertEquals(result['c'], '3 &a')
def test_url_query_parameters(self): ''' Should generate a correct signature with URL query parameters. ''' tc = create_test_tc() tc.launch_url = 'http://dr-chuck.com/ims/php-simple/tool.php?a=1&b=2&c=3%20%26a' result = tc.generate_launch_data() self.assertNotEqual(result, None) self.assertEqual(result['oauth_signature'], 'kiObbrNVu4vHzd0+yVDHvrsvegQ=') self.assertEqual(result['c'], '3 &a')
def setUp(self): self.params = create_params_tp() self.tool = create_test_tc(params = self.params)