aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authormadt1m <pietrotirenna.pt@gmail.com>2018-07-24 15:57:11 +0200
committermadt1m <pietrotirenna.pt@gmail.com>2018-07-24 15:57:11 +0200
commit8c7793b91a2a182ec7d7831f2c03283dad3488cc (patch)
tree70f33535f4056b71882e9851048d3285223beeec /test
parent68eb07b668b44074271b358b25e48ffd2b4726e0 (diff)
downloadmitmproxy-8c7793b91a2a182ec7d7831f2c03283dad3488cc.tar.gz
mitmproxy-8c7793b91a2a182ec7d7831f2c03283dad3488cc.tar.bz2
mitmproxy-8c7793b91a2a182ec7d7831f2c03283dad3488cc.zip
session: temporary DB is now stored in temporary dir
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/addons/test_session.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/mitmproxy/addons/test_session.py b/test/mitmproxy/addons/test_session.py
index cb36e283..d4b1109b 100644
--- a/test/mitmproxy/addons/test_session.py
+++ b/test/mitmproxy/addons/test_session.py
@@ -8,10 +8,14 @@ from mitmproxy.utils.data import pkg_data
class TestSession:
- def test_session_temporary(self, tdata):
+ def test_session_temporary(self):
s = session.SessionDB()
- filename = s.temp.name
+ td = s.tempdir
+ filename = os.path.join(td, 'tmp.sqlite')
assert session.SessionDB.is_session_db(filename)
+ assert os.path.isdir(td)
+ del s
+ assert not os.path.isdir(td)
def test_session_not_valid(self, tdata):
path = tdata.path('mitmproxy/data/') + '/test_snv.sqlite'