Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
afeena committed Feb 29, 2020
2 parents c756c3e + f129479 commit b123cc7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ before_install:
- sudo service mysql restart
language: python
python:
- "3.5"
- "3.6"
- "3.7"
# command to install dependencies
Expand Down
4 changes: 2 additions & 2 deletions tanner/tests/test_mysql_db_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ def test_copy_db(self, m):
self.expected_outs = b''

dump1 = 'mysqldump --compact --skip-extended-insert -h {host} -u {user} -p{password}' \
'test_db>/tmp/db/file1.sql'
' test_db>/tmp/db/file1.sql'
dump1 = dump1.format(host=TannerConfig.get('SQLI', 'host'),
user=TannerConfig.get('SQLI', 'user'),
password=TannerConfig.get('SQLI', 'password'))
dump2 = "mysqldump --compact --skip-extended-insert -h {host} -u {user} -p{password}" \
"attacker_db>/tmp/db/file2.sql"
" attacker_db>/tmp/db/file2.sql"
dump2 = dump2.format(host=TannerConfig.get('SQLI', 'host'),
user=TannerConfig.get('SQLI', 'user'),
password=TannerConfig.get('SQLI', 'password'))
Expand Down
16 changes: 8 additions & 8 deletions tanner/tests/test_web_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
class TestWebServer(AioHTTPTestCase):
def setUp(self):
self.loop = asyncio.new_event_loop()
redis = mock.Mock()
redis.close = mock.Mock()

self.handler = TannerWebServer()
self.handler.redis_client = redis
self.handler.api = Api(self.handler.redis_client)
self.handler.api = AsyncMock()
self.handler.redis_client = AsyncMock()
self.handler.redis_client.close = AsyncMock()

self.returned_content = None
self.expected_content = None
Expand All @@ -28,12 +27,12 @@ def get_app(self):

@unittest_run_loop
async def test_handle_index(self):
self.handler.api.return_snares = AsyncMock(return_value=["foo"])
self.handler.api.return_latest_session = AsyncMock()
response = await self.client.request('GET', '/')
self.returned_content = await response.text()

self.expected_content = '<html>\n<head>\n\t<title>Home - Tanner Web</title>\n\t'

self.assertIn(self.expected_content, self.returned_content)
self.assertEqual(response.status, 200)

@unittest_run_loop
async def test_handle_snares(self):
Expand Down Expand Up @@ -110,7 +109,8 @@ async def test_handle_sessions_error(self):

@unittest_run_loop
async def test_sessions_info(self):
session = dict(cookies={'sess_uuid': '9f82e5d0e6b64047bba996222d45e72c'}, possible_owners={"user": 1.0})
session = dict(cookies={'sess_uuid': '9f82e5d0e6b64047bba996222d45e72c'},
possible_owners={"user": 1.0}, attack_count={"lfi": 1})

self.handler.api.return_session_info = AsyncMock(return_value=session)

Expand Down

0 comments on commit b123cc7

Please sign in to comment.