Hosts: Error when running testUpdateHostsFile.py

Created on 8 Jul 2020  路  3Comments  路  Source: StevenBlack/hosts

I wonder why I got this error when running testUpdateHostsFile.py
updateHostsFile.py run just fine

I already installed the dependencies with pip. My python version is 3.8.2

PS C:\Users\blue\Utility\hosts-master> python .\testUpdateHostsFile.py
..............................................................................................F.FF............
======================================================================
FAIL: test_add_fields (__main__.TestUpdateReadmeData)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\testUpdateHostsFile.py", line 1136, in test_add_fields
    self.assertEqual(actual, expected)
AssertionError: {'foo': 'bar', 'base': {'location': 'foo/',[34 chars]ts'}} != {'base': {'location': 'foo\\', 'sourcesdata[35 chars]bar'}
- {'base': {'entries': 5, 'location': 'foo/', 'sourcesdata': 'hosts'},
?                                         ^

+ {'base': {'entries': 5, 'location': 'foo\\', 'sourcesdata': 'hosts'},
?                                         ^^

   'foo': 'bar'}

======================================================================
FAIL: test_modify_fields (__main__.TestUpdateReadmeData)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\testUpdateHostsFile.py", line 1153, in test_modify_fields
    self.assertEqual(actual, expected)
AssertionError: {'base': {'location': 'foo/', 'entries': 5, 'sourcesdata': 'hosts'}} != {'base': {'location': 'foo\\', 'sourcesdata': 'hosts', 'entries': 5}}
- {'base': {'entries': 5, 'location': 'foo/', 'sourcesdata': 'hosts'}}
?                                         ^

+ {'base': {'entries': 5, 'location': 'foo\\', 'sourcesdata': 'hosts'}}
?                                         ^^


======================================================================
FAIL: test_set_extensions (__main__.TestUpdateReadmeData)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\testUpdateHostsFile.py", line 1177, in test_set_extensions
    self.assertEqual(actual, expected)
AssertionError: {'com-org': {'location': 'foo/', 'entries': 5, 'sourcesdata': 'hosts'}} != {'com-org': {'location': 'foo\\', 'sourcesdata': 'hosts', 'entries': 5}}
- {'com-org': {'entries': 5, 'location': 'foo/', 'sourcesdata': 'hosts'}}
?                                            ^

+ {'com-org': {'entries': 5, 'location': 'foo\\', 'sourcesdata': 'hosts'}}
?                                            ^^


----------------------------------------------------------------------
Ran 110 tests in 0.118s

FAILED (failures=3)
tests

Most helpful comment

If this is fixed we can try running CI on Windows too (maybe just one Python version, though). I guess it would make things consistent :)

All 3 comments

I guess tests only work on nix and don't handle the Windows separator.

Thanks @onmyouji, good catch.

If this is fixed we can try running CI on Windows too (maybe just one Python version, though). I guess it would make things consistent :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikhoul picture mikhoul  路  3Comments

Laicure picture Laicure  路  3Comments

gadgetchnnel picture gadgetchnnel  路  3Comments

CyanoTex picture CyanoTex  路  3Comments

node1634 picture node1634  路  3Comments