Skip to content

Commit

Permalink
Update python_requires in setup.py, fix hostsmanager_test and remove …
Browse files Browse the repository at this point in the history
…requirements.txt
  • Loading branch information
anned20 committed Jun 15, 2019
1 parent 2c90fce commit 8dfda37
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
14 changes: 7 additions & 7 deletions begoneads/hostsmanager_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,35 @@
def test_has_begoneads():
with patch('builtins.open', mock_open(read_data=without_begoneads)) as mock_file:
hosts_manager = HostsManager('/etc/hosts')
mock_file.assert_called_with('/etc/hosts', 'r')
mock_file.assert_called_with('/etc/hosts', 'r', encoding='utf-8')

assert hosts_manager.has_begoneads() == None

with patch('builtins.open', mock_open(read_data=with_begoneads)) as mock_file:
hosts_manager = HostsManager('/etc/hosts')
mock_file.assert_called_with('/etc/hosts', 'r')
mock_file.assert_called_with('/etc/hosts', 'r', encoding='utf-8')

assert str(hosts_manager.has_begoneads()).startswith('<re.Match')
assert hosts_manager.has_begoneads()


def test_apply_hosts():
with patch('builtins.open', mock_open(read_data=without_begoneads)) as mock_file:
hosts_manager = HostsManager('/etc/hosts')
mock_file.assert_called_with('/etc/hosts', 'r')
mock_file.assert_called_with('/etc/hosts', 'r', encoding='utf-8')

assert hosts_manager.has_begoneads() == None

hosts_manager.apply_hosts('0.0.0.0 some.test')

assert str(hosts_manager.has_begoneads()).startswith('<re.Match')
assert hosts_manager.has_begoneads()


def test_remove_begoneads():
with patch('builtins.open', mock_open(read_data=with_begoneads)) as mock_file:
hosts_manager = HostsManager('/etc/hosts')
mock_file.assert_called_with('/etc/hosts', 'r')
mock_file.assert_called_with('/etc/hosts', 'r', encoding='utf-8')

assert str(hosts_manager.has_begoneads()).startswith('<re.Match')
assert hosts_manager.has_begoneads()

hosts_manager.remove_begoneads()

Expand Down
16 changes: 0 additions & 16 deletions requirements.txt

This file was deleted.

3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ def readme():

setup(
name='begoneads',
version='0.0.6',
version='0.0.7',
description='BeGoneAds puts some popular hosts file lists into the hosts file as a adblocker measure.',
python_requires='>=3.6',
long_description=readme(),
long_description_content_type="text/markdown",
url='http://github.com/anned20/begoneads',
Expand Down

0 comments on commit 8dfda37

Please sign in to comment.