# Path: jasmine/js_api_parser.py
# class Parser(object):
#     RESULT_FIELDS = {
#         'status': 'status',
#         'fullName': 'full_name',
#         'failedExpectations': 'failed_expectations',
#         'deprecationWarnings': 'deprecation_warnings',
#         'id': 'runnable_id',
#         'description': 'description',
#         'pendingReason': 'pending_reason'
#     }
# 
#     def parse(self, items):
#         result_list = ResultList()
#         for item in self._filter_fields(items):
#             result_list.add_result(item)
#         return result_list
# 
#     def _filter_fields(self, raw_items):
#         filtered_items = []
#         for item in raw_items:
#             filtered_items.append(dict((
#                 (self._to_snake_case(k), v)
#                 for k, v in item.items()
#                 if k in self.RESULT_FIELDS.keys()
#             )))
#         return filtered_items
# 
#     def _to_snake_case(self, key):
#         return self.RESULT_FIELDS[key]


from jasmine.js_api_parser import Parser
                    u'message': u'old and busted',
                    u'stack': u'snacky stack'
                }
            ],
            u'id': 0,
            u'description': u'refer to the most holy',
            u'pendingReason': u'pending reason'
        }
    ])

    assert len(results) == 1
    assert results[0].status == 'failed'
    assert results[0].full_name == 'Globals refer to the most holy.'
    assert len(results[0].failed_expectations) == 1
    assert results[0].failed_expectations[0]['stack'] == "stack\n    stack\n    stack"
    assert results[0].failed_expectations[0]['message'] == "Expected 'Batman' to equal 'PANTS'."
    assert results[0].pending_reason == u'pending reason'
    assert len(results[0].deprecation_warnings) == 1
    assert results[0].deprecation_warnings[0]['message'] == "old and busted"
    assert results[0].deprecation_warnings[0]['stack'] == "snacky stack"


def test_parser_returns_an_empty_results_list_with_no_runnables():
    parser = Parser()
    results = parser.parse([])

    assert len(results) == 0


def test_parser_returns_all_failed_expectations():

# Path: jasmine/js_api_parser.py
# class Parser(object):
#     RESULT_FIELDS = {
#         'status': 'status',
#         'fullName': 'full_name',
#         'failedExpectations': 'failed_expectations',
#         'deprecationWarnings': 'deprecation_warnings',
#         'id': 'runnable_id',
#         'description': 'description',
#         'pendingReason': 'pending_reason'
#     }
# 
#     def parse(self, items):
#         result_list = ResultList()
#         for item in self._filter_fields(items):
#             result_list.add_result(item)
#         return result_list
# 
#     def _filter_fields(self, raw_items):
#         filtered_items = []
#         for item in raw_items:
#             filtered_items.append(dict((
#                 (self._to_snake_case(k), v)
#                 for k, v in item.items()
#                 if k in self.RESULT_FIELDS.keys()
#             )))
#         return filtered_items
# 
#     def _to_snake_case(self, key):
#         return self.RESULT_FIELDS[key]


# Path: test/js_api_parser_test.py
from jasmine.js_api_parser import Parser

                    u'message': u'old and busted',
                    u'stack': u'snacky stack'
                }
            ],
            u'id': 0,
            u'description': u'refer to the most holy',
            u'pendingReason': u'pending reason'
        }
    ])

    assert len(results) == 1
    assert results[0].status == 'failed'
    assert results[0].full_name == 'Globals refer to the most holy.'
    assert len(results[0].failed_expectations) == 1
    assert results[0].failed_expectations[0]['stack'] == "stack\n    stack\n    stack"
    assert results[0].failed_expectations[0]['message'] == "Expected 'Batman' to equal 'PANTS'."
    assert results[0].pending_reason == u'pending reason'
    assert len(results[0].deprecation_warnings) == 1
    assert results[0].deprecation_warnings[0]['message'] == "old and busted"
    assert results[0].deprecation_warnings[0]['stack'] == "snacky stack"


def test_parser_returns_an_empty_results_list_with_no_runnables():
    parser = Parser()
    results = parser.parse([])

    assert len(results) == 0


def test_parser_returns_all_failed_expectations():

    parser = Parser()