示例#1
0
 def test_can_summarize_mutation(self):
     # summarize a mock mutation
     summarized = summarize_mutation(mutation_name='test_mutation',
                                     event='foo.bar',
                                     inputs=['foo', 'bar'],
                                     outputs=['bar', 'baz'])
     # check that it matches what we expect
     expected = {
         'name': 'test_mutation',
         'event': 'foo.bar',
         'isAsync': False,
         'inputs': ['foo', 'bar'],
         'outputs': ['bar', 'baz']
     }
     # make sure the two match
     assert summarized == expected, (
         "Summarized mutation did not match expectation.")
示例#2
0
 def test_can_summarize_mutation(self):
     # summarize a mock mutation
     summarized = summarize_mutation(
         mutation_name='test_mutation',
         event='foo.bar',
         inputs=['foo','bar'],
         outputs=['bar','baz']
     )
     # check that it matches what we expect
     expected = {
         'name': 'test_mutation',
         'event': 'foo.bar',
         'isAsync': False,
         'inputs': ['foo','bar'],
         'outputs': ['bar','baz']
     }
     # make sure the two match
     assert summarized == expected, (
         "Summarized mutation did not match expectation."
     )
示例#3
0
    def test_can_summarize_async_mutation(self):
        # summarize a mock mutation
        summarized = summarize_mutation('test_mutation',
                                        'foo.bar',
                                        isAsync=True,
                                        inputs=['foo', 'bar'],
                                        outputs=['bar', 'baz'])

        # check that it matches what we expect
        expected = {
            'name': 'test_mutation',
            'event': 'foo.bar',
            'isAsync': True,
            'inputs': ['foo', 'bar'],
            'outputs': ['bar', 'baz']
        }
        # make sure the two match
        assert summarized == expected, (
            "Summarized async mutation did not match expectation. Found {}, expected {}"\
                .format(summarized, expected)
        )
示例#4
0
    def test_can_summarize_async_mutation(self):
        # summarize a mock mutation
        summarized = summarize_mutation(
            'test_mutation',
            'foo.bar',
            isAsync=True,
            inputs=['foo','bar'],
            outputs=['bar','baz']
        )

        # check that it matches what we expect
        expected = {
            'name': 'test_mutation',
            'event': 'foo.bar',
            'isAsync': True,
            'inputs':['foo','bar'],
            'outputs': ['bar','baz']
        }
        # make sure the two match
        assert summarized == expected, (
            "Summarized async mutation did not match expectation. Found {}, expected {}"\
                .format(summarized, expected)
        )