# Path: jasmine/result_list.py
# class ResultList(list):
# 
#     def add_result(self, result):
#         self.append(Result(**result))
# 
#     def passed(self):
#         return self._filter_status('passed')
# 
#     def failed(self):
#         return self._filter_status('failed')
# 
#     def pending(self):
#         return self._filter_status('pending')
# 
#     def enabled(self):
#         return [result for result in self if result.status != 'disabled']
# 
#     def _filter_status(self, status):
#         return [result for result in self if result.status == status]
# 
#     def __add__(self, other):
#         return ResultList(list.__add__(self, other))


from mock import Mock
from jasmine.result_list import ResultList
import pytest



@pytest.fixture
def result_list():
    return ResultList([
        Mock(status='passed', id='pass'),
        Mock(status='failed', id='fail'),
        Mock(status='pending', id='pend'),
        Mock(status='disabled', id='disable'),
    ])


def test_result_list_passed(result_list):
    passed = result_list.passed()
    assert len(passed) == 1
    assert passed[0].id == 'pass'


def test_result_list_failed(result_list):
    failed = result_list.failed()
    assert len(failed) == 1
    assert failed[0].id == 'fail'



# Path: jasmine/result_list.py
# class ResultList(list):
# 
#     def add_result(self, result):
#         self.append(Result(**result))
# 
#     def passed(self):
#         return self._filter_status('passed')
# 
#     def failed(self):
#         return self._filter_status('failed')
# 
#     def pending(self):
#         return self._filter_status('pending')
# 
#     def enabled(self):
#         return [result for result in self if result.status != 'disabled']
# 
#     def _filter_status(self, status):
#         return [result for result in self if result.status == status]
# 
#     def __add__(self, other):
#         return ResultList(list.__add__(self, other))


# Path: test/result_list_test.py
from mock import Mock
from jasmine.result_list import ResultList
import pytest




@pytest.fixture
def result_list():
    return ResultList([
        Mock(status='passed', id='pass'),
        Mock(status='failed', id='fail'),
        Mock(status='pending', id='pend'),
        Mock(status='disabled', id='disable'),
    ])


def test_result_list_passed(result_list):
    passed = result_list.passed()
    assert len(passed) == 1
    assert passed[0].id == 'pass'


def test_result_list_failed(result_list):
    failed = result_list.failed()
    assert len(failed) == 1
    assert failed[0].id == 'fail'



def test_result_list_pending(result_list):