Skip to content

Commit

Permalink
Revert "add test"
Browse files Browse the repository at this point in the history
This reverts commit 3572b34.
  • Loading branch information
vickyliin committed Aug 3, 2023
1 parent 3572b34 commit facceff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
6 changes: 3 additions & 3 deletions tests/integration/test_disksaver.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_disk_saver_nowrite(tmpdir, mockbin_request_url):
fname = str(tmpdir.join("synopsis.yaml"))
with vcr.use_cassette(fname) as cass:
urlopen(mockbin_request_url).read()
assert cass.play_count == 1
assert cass.play_count == 0
last_mod = os.path.getmtime(fname)

with vcr.use_cassette(fname) as cass:
Expand All @@ -41,7 +41,7 @@ def test_disk_saver_write(tmpdir, mockbin_request_url):
fname = str(tmpdir.join("synopsis.yaml"))
with vcr.use_cassette(fname) as cass:
urlopen(mockbin_request_url).read()
assert cass.play_count == 1
assert cass.play_count == 0
last_mod = os.path.getmtime(fname)

# Make sure at least 1 second passes, otherwise sometimes
Expand All @@ -51,7 +51,7 @@ def test_disk_saver_write(tmpdir, mockbin_request_url):
with vcr.use_cassette(fname, record_mode=vcr.mode.ANY) as cass:
urlopen(mockbin_request_url).read()
urlopen(mockbin_request_url + "/get").read()
assert cass.play_count == 2
assert cass.play_count == 1
assert cass.dirty
last_mod2 = os.path.getmtime(fname)

Expand Down
7 changes: 0 additions & 7 deletions tests/unit/test_cassettes.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def test_cassette_append():
a.append("foo", "bar")
assert a.requests == ["foo"]
assert a.responses == ["bar"]
assert a.play_count == 1


def test_cassette_len():
Expand All @@ -73,7 +72,6 @@ def _mock_requests_match(request1, request2, matchers):
def test_cassette_contains():
a = Cassette("test")
a.append("foo", "bar")
a.rewind()
assert "foo" in a


Expand All @@ -95,7 +93,6 @@ def test_cassette_get_missing_response():
def test_cassette_cant_read_same_request_twice():
a = Cassette("test")
a.append("foo", "bar")
a.rewind()
a.play_response("foo")
with pytest.raises(UnhandledHTTPRequestError):
a.play_response("foo")
Expand Down Expand Up @@ -146,15 +143,13 @@ def function():
def test_cassette_not_all_played():
a = Cassette("test")
a.append("foo", "bar")
a.rewind()
assert not a.all_played


@mock.patch("vcr.cassette.requests_match", _mock_requests_match)
def test_cassette_all_played():
a = Cassette("test")
a.append("foo", "bar")
a.rewind()
a.play_response("foo")
assert a.all_played

Expand All @@ -164,7 +159,6 @@ def test_cassette_allow_playback_repeats():
a = Cassette("test", allow_playback_repeats=True)
a.append("foo", "bar")
a.append("other", "resp")
a.rewind()
for _ in range(10):
assert a.play_response("foo") == "bar"
assert a.play_count == 10
Expand All @@ -189,7 +183,6 @@ def test_cassette_allow_playback_repeats():
def test_cassette_rewound():
a = Cassette("test")
a.append("foo", "bar")
a.rewind()
a.play_response("foo")
assert a.all_played

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def _get_cassette_library_dir(self):
test = run_testcase(MyTest)[0][0]
assert b"illustrative examples" in test.response
assert len(test.cassette.requests) == 1
assert test.cassette.play_count == 1
assert test.cassette.play_count == 0

# Second test reads from cassette.

Expand Down

0 comments on commit facceff

Please sign in to comment.