def test_without_encoding(self):
     self.assertEqual(_generate_plaintext_signature(b("ab cd"), b("47 f$a"),
                                                    False), b("ab cd&47 f$a"))
 def test_both_secrets_are_encoded(self):
     self.assertEqual(_generate_plaintext_signature(b("ab cd"), b("47 f$a")),
                  b("ab%20cd&47%20f%24a"))
 def test_both_secrets_absent(self):
     self.assertEqual(_generate_plaintext_signature(None, None), b("&"))
     self.assertEqual(_generate_plaintext_signature(b(""), b("")), b("&"))
 def test_token_secret_absent(self):
     self.assertEqual(
         _generate_plaintext_signature(b("ab cd"), None), b("ab%20cd&"))
     self.assertEqual(
         _generate_plaintext_signature(b("ab cd"), b("")), b("ab%20cd&"))
 def test_consumer_secret_absent(self):
     self.assertEqual(_generate_plaintext_signature(None, b("47fba")),
                      b("&47fba"))
     self.assertEqual(_generate_plaintext_signature(
         b(""), b("47fba")), b("&47fba"))
 def test_both_secrets_present(self):
     self.assertEqual(_generate_plaintext_signature(b("ab cd"), b("47fba")),
                  b("ab%20cd&47fba"))