def test_compose_query_params_raises_error_for_invalid_query_dict_that_has_multiple_values_for_exclusive_keys( self, ): query_dict = { 'status': ['Running', 'Failed', 'Submitted'], 'start': ['2018-01-01T00:00:00.000Z', '2018-01-02T00:00:00.000Z'], 'end': '2018-01-01T12:00:00.000Z', 'label': {'Comment1': 'test1', 'Comment2': 'test2', 'Comment3': 'test3'}, } with self.assertRaises(ValueError): CromwellAPI._compose_query_params(query_dict)
def test_compose_query_params_can_convert_bools_within_query_dicts(self): query_dict = { 'status': ['Running', 'Failed', 'Submitted'], 'start': '2018-01-01T00:00:00.000Z', 'end': '2018-01-01T12:00:00.000Z', 'label': { 'Comment1': 'test1', 'Comment2': 'test2', 'Comment3': 'test3' }, 'includeSubworkflows': True, } expect_params = [ { 'status': 'Running' }, { 'status': 'Failed' }, { 'status': 'Submitted' }, { 'start': '2018-01-01T00:00:00.000Z' }, { 'end': '2018-01-01T12:00:00.000Z' }, { 'label': 'Comment1:test1' }, { 'label': 'Comment2:test2' }, { 'label': 'Comment3:test3' }, { 'includeSubworkflows': 'true' }, ] six.assertCountEqual(self, CromwellAPI._compose_query_params(query_dict), expect_params)
def test_compose_query_params_can_compose_simple_query_dicts(self): query_dict = { 'status': 'Running', 'start': '2018-01-01T00:00:00.000Z', 'end': '2018-01-01T12:00:00.000Z', 'label': {'Comment': 'test'}, 'page': 1, 'pageSize': 10, } expect_params = [ {'status': 'Running'}, {'start': '2018-01-01T00:00:00.000Z'}, {'end': '2018-01-01T12:00:00.000Z'}, {'label': 'Comment:test'}, {'page': '1'}, {'pageSize': '10'}, ] six.assertCountEqual( self, CromwellAPI._compose_query_params(query_dict), expect_params )