Esempio n. 1
0
def test_additional_row_same_val(request):
    filename = 'additional_row_with_same_value.html'
    file_path = PATH + filename
    expected_exception = 'HTML Parse Error : expected row key : margin and actual row key : additional row'
    with open(file_path, 'r') as html_file:
        html = html_file.read()
    with pytest.raises(Exception) as exception_info:
        helper.parse_to_dict(html)
    actual_exception = exception_info.value.args[0]
    assert actual_exception.lower() == expected_exception.lower()
Esempio n. 2
0
def test_additional_column(request):
    filename = 'additional_column.html'
    file_path = PATH + filename
    expected_exception = 'HTML Parse Error : expected heading : actual and actual heading : additionalcolumn'
    with open(file_path, 'r') as html_file:
        html = html_file.read()
    with pytest.raises(Exception) as exception_info:
        helper.parse_to_dict(html)
    actual_exception = exception_info.value.args[0]
    assert actual_exception.lower() == expected_exception.lower()
Esempio n. 3
0
def test_updated_row_name(request):
    filename = 'update_row_name.html'
    file_path = PATH + filename
    expected_exception = 'HTML Parse Error : expected row key : billable hrs and actual row key : billable-updated hrs'
    with open(file_path, 'r') as html_file:
        html = html_file.read()
    with pytest.raises(Exception) as exception_info:
        helper.parse_to_dict(html)
    actual_exception = exception_info.value.args[0]
    assert actual_exception.lower() == expected_exception.lower()
Esempio n. 4
0
def test_delete_row(request):
    filename = 'delete_row.html'
    file_path = PATH + filename
    expected_exception = 'HTML Parse Error : expected row key : capitalized cost and actual row key : non-capitalized cost'
    with open(file_path, 'r') as html_file:
        html = html_file.read()
    with pytest.raises(Exception) as exception_info:
        helper.parse_to_dict(html)
    actual_exception = exception_info.value.args[0]
    assert actual_exception.lower() == expected_exception.lower()
Esempio n. 5
0
def test_positive(request):
    filename = 'positive.html'
    file_path = PATH + filename
    with open(file_path, 'r') as html_file:
        html = html_file.read()
    actual_dict = helper.parse_to_dict(html)
    status, remarks = Asserter().verify(actual_dict,
                                        expected_dct=EXPECTED_DICT)
    assert status
Esempio n. 6
0
 def get_actual(self):
     api = self.urls['rollup'][ENTITY]
     url = api.format(
         protocol='https',
         env=self.cmd_options['env'],
         project_id=self.project_id)
     response = self.rqst_session.get(url, cookies={
         'JSESSIONID': self.jsessionid}, headers={
         'X-Requested-With': 'XMLHttpRequest'})
     actual_dct = helper.parse_to_dict(response.content)
     return actual_dct