Skip to content

Commit

Permalink
Resolve linter warnings on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeacom committed Feb 8, 2018
1 parent 57068e0 commit 26f5d13
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions app/dashboard/tests/test_dashboard_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ def setUp(self):

def test_amount(self):
"""Test the dashboard helper amount method."""
params = { 'amount': '5', 'denomination': 'ETH' }
params = {'amount': '5', 'denomination': 'ETH'}
request = self.factory.get('/sync/get_amount', params)
assert amount(request).content == b'{"eth": 5.0, "usdt": 10.0}'

def test_title(self):
"""Test the dashboard helper title method."""
sample_url = 'https://github.com/gitcoinco/web/issues/353'
params = { 'url': sample_url, 'denomination': 'ETH' }
params = {'url': sample_url, 'denomination': 'ETH'}
with requests_mock.Mocker() as m:
m.get(sample_url, text='<span class="js-issue-title refined-linkified-title">Increase Code Coverage by 4%</span>')
request = self.factory.get('/sync/get_issue_title', params)
Expand All @@ -57,7 +57,7 @@ def test_title(self):
def test_description(self):
"""Test the dashboard helper description method."""
sample_url = 'https://github.com/gitcoinco/web/issues/353'
params = { 'url': sample_url }
params = {'url': sample_url}
with requests_mock.Mocker() as m:
m.get('https://api.github.com/repos/gitcoinco/web/issues/353', text='{"body": "This bounty will be paid out to anyone who meaningfully increases the code coverage of the repository by 4%."}')
request = self.factory.get('/sync/get_issue_description', params)
Expand All @@ -66,7 +66,7 @@ def test_description(self):
def test_keywords(self):
"""Test the dashboard helper keywords method."""
sample_url = 'https://github.com/gitcoinco/web/issues/353'
params = { 'url': sample_url }
params = {'url': sample_url}
with requests_mock.Mocker() as m:
m.get('https://github.com/gitcoinco/web', text='<span class="lang">hello</span><span class="lang">world</span>')
request = self.factory.get('/sync/get_issue_keywords', params)
Expand Down
14 changes: 7 additions & 7 deletions app/dashboard/tests/test_dashboard_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_bounty(self):
accepted=True,
expires_date=datetime(2008, 11, 30),
fulfiller_address="0x0000000000000000000000000000000000000000",
idx_project_length = 5,
idx_project_length=5,
bounty_type='Feature',
experience_level='Intermediate',
)
Expand All @@ -63,17 +63,17 @@ def test_bounty(self):
assert bounty.title_or_desc == 'foo'
assert bounty.issue_description_text == 'hello world'
assert bounty.org_name == 'gitcoinco'
assert bounty.is_hunter('fred') == True
assert bounty.is_hunter('flintstone') == False
assert bounty.is_funder('fred') == False
assert bounty.is_funder('flintstone') == True
assert bounty.is_hunter('fred') is True
assert bounty.is_hunter('flintstone') is False
assert bounty.is_funder('fred') is False
assert bounty.is_funder('flintstone') is True
assert bounty.get_avatar_url
assert bounty.status == 'expired'
assert bounty.value_true == 3e-18
assert bounty.value_in_eth == 3
assert bounty.value_in_usdt == 0
assert 'ago 5 Feature Intermediate' in bounty.desc
assert bounty.is_legacy == False
assert bounty.is_legacy is False
assert bounty.get_github_api_url() == 'https://api.github.com/repos/gitcoinco/web'

def test_tip(self):
Expand Down Expand Up @@ -125,7 +125,7 @@ def test_profile(self):
repos_data=[{'contributors': [{'contributions': 50, 'login': 'foo'}]}],
)
assert str(profile) == 'gitcoinco'
assert profile.is_org == True
assert profile.is_org is True
assert profile.bounties.first() == bounty
assert profile.tips.first() == tip
assert profile.authors == ['foo', 'gitcoinco']
Expand Down

0 comments on commit 26f5d13

Please sign in to comment.