Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix directory separator under Windows. #1336

Merged
merged 4 commits into from Jul 13, 2020

Conversation

funilrys
Copy link
Contributor

@funilrys funilrys commented Jul 9, 2020

This patch fixes #1332.

@funilrys funilrys changed the title Fix directory separtor under Windows. Fix directory separator under Windows. Jul 9, 2020
@funilrys
Copy link
Contributor Author

funilrys commented Jul 9, 2020

Please check @XhmikosR @onmyouji.

Stay safe and healthy.
Nissar

@StevenBlack
Copy link
Owner

Ping @XhmikosR and @onmyouji. I'd like to merge this. Is this cool on Win?

@XhmikosR
Copy link
Contributor


C:\Users\xmr\Desktop\hosts>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.080s

FAILED (failures=3)

@onmyouji
Copy link

It still fails

python .\testUpdateHostsFile.py
..............................................................................................F.FF............
======================================================================
FAIL: test_add_fields (__main__.TestUpdateReadmeData)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\testUpdateHostsFile.py", line 1139, 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 1156, 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 1180, 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.110s

FAILED (failures=3)

@funilrys
Copy link
Contributor Author

Please recheck with my latest change @onmyouji @XhmikosR !

Stay safe and healthy.
Nissar

@onmyouji
Copy link

python .\testUpdateHostsFile.py
............................F...............F.F...............................................................
======================================================================
FAIL: test_get_defaults (__main__.TestGetDefaults)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\testUpdateHostsFile.py", line 132, in test_get_defaults
    self.assertDictEqual(actual, expected)
AssertionError: {'num[27 chars] 'foo\\data', 'freshen': True, 'replace': Fals[619 chars]ist'} != {'num[27 chars] 'foo/data', 'freshen': True, 'replace': False[613 chars]ist'}
Diff is 1349 characters long. Set self.maxDiff to None to see it.

======================================================================
FAIL: test_join (__main__.TestPathJoinRobust)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\testUpdateHostsFile.py", line 1882, in test_join
    self.assertEqual(actual, expected)
AssertionError: 'path1\\pathNew' != 'path1/pathNew'
- path1\pathNew
?      ^
+ path1/pathNew
?      ^


======================================================================
FAIL: test_join_unicode (__main__.TestPathJoinRobust)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\testUpdateHostsFile.py", line 1890, in test_join_unicode
    self.assertEqual(actual, expected)
AssertionError: 'path1\\pathNew' != 'path1/pathNew'
- path1\pathNew
?      ^
+ path1/pathNew
?      ^


----------------------------------------------------------------------
Ran 110 tests in 0.120s

FAILED (failures=3)

Instead of changing the directory separator globally, we change it only
when we generate/update the readme data file.
@funilrys
Copy link
Contributor Author

Thanks for the feedback @onmyouji. Can you test again (hopefully for the last time for this issue) ?

Thanks again for your feedback!

@onmyouji
Copy link

python .\testUpdateHostsFile.py
..............................................................................................................
----------------------------------------------------------------------
Ran 110 tests in 0.097s

OK

@funilrys
Copy link
Contributor Author

It's yours Steve @StevenBlack !

@StevenBlack
Copy link
Owner

THANK YOU everyone! Excellent effort Nissar @funilrys.

Merging!

@StevenBlack StevenBlack merged commit 323174e into StevenBlack:master Jul 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when running testUpdateHostsFile.py
4 participants