def __init__(self, *args, **kwargs):
        """
        Constructor for GenerateEventCommand class that brings together
        ServiceCommand and EventTypeSubCommand into one class

        Parameters
        ----------
        args: tuple
            any arguments passed in before kwargs
        kwargs: dict
            commands, subcommands, and parameters for generate-event
        """
        super(GenerateEventCommand, self).__init__(events.Events(), *args, **kwargs)
예제 #2
0
 def test_if_tags_is_two_or_more(self):
     tags = {
         "hello": {
             "encoding": "base64"
         },
         "hi": {
             "encoding": "url"
         },
         "bop": {
             "encoding": "None"
         }
     }
     values_to_sub = {"bop": "dop", "hello": "world", "hi": "yo"}
     e = events.Events().encode(tags, "encoding", values_to_sub)
     self.assertEqual(e, {"bop": "dop", "hello": "d29ybGQ=", "hi": "yo"})
예제 #3
0
 def test_if_tags_is_empty(self):
     tags = {}
     e = events.Events().encode(tags, "encoding", {})
     self.assertEqual(e, {})
예제 #4
0
 def test_if_encoding_is_none(self):
     tags = {"hello": {"encoding": "None"}}
     e = events.Events().encode(tags, "encoding", self.values_to_sub)
     self.assertEqual(e, {"hello": "world"})
예제 #5
0
 def test_url_encoding(self):
     tags = {"hello": {"encoding": "url"}}
     e = events.Events().encode(tags, "encoding", self.values_to_sub)
     self.assertEqual(e, {"hello": "world"})
예제 #6
0
 def test_base64_encoding(self):
     tags = {"hello": {"encoding": "base64"}}
     e = events.Events().encode(tags, "encoding", self.values_to_sub)
     self.assertEqual(e, {"hello": "d29ybGQ="})