mirror of
https://github.com/senju1337/senju.git
synced 2025-12-24 07:39:29 +00:00
test: move test_temp_data_dir to store tests
Refs: OPS-70
This commit is contained in:
parent
e700c0d4cb
commit
0c0554e931
2 changed files with 10 additions and 10 deletions
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import os
|
|
||||||
import json
|
import json
|
||||||
from pytest_httpserver import HTTPServer
|
from pytest_httpserver import HTTPServer
|
||||||
import requests
|
import requests
|
||||||
|
|
@ -21,15 +20,6 @@ from senju.haiku import Haiku # noqa: F401
|
||||||
# Rust's libtest
|
# Rust's libtest
|
||||||
|
|
||||||
|
|
||||||
def test_temp_data_dir(temp_data_dir):
|
|
||||||
print(temp_data_dir)
|
|
||||||
testpath = temp_data_dir / "__test"
|
|
||||||
with open(testpath, "w") as f:
|
|
||||||
f.write("that dir actually works")
|
|
||||||
os.remove(testpath)
|
|
||||||
assert not os.path.exists(testpath)
|
|
||||||
|
|
||||||
|
|
||||||
def test_create_haiku():
|
def test_create_haiku():
|
||||||
haiku = Haiku(["line number 1", "line number 2", "line number 3"])
|
haiku = Haiku(["line number 1", "line number 2", "line number 3"])
|
||||||
assert haiku.lines[0] == "line number 1"
|
assert haiku.lines[0] == "line number 1"
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,21 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import pytest # noqa: F401
|
import pytest # noqa: F401
|
||||||
|
import os
|
||||||
|
|
||||||
from senju.haiku import DEFAULT_HAIKU, Haiku
|
from senju.haiku import DEFAULT_HAIKU, Haiku
|
||||||
from senju.store_manager import StoreManager # noqa: F401
|
from senju.store_manager import StoreManager # noqa: F401
|
||||||
|
|
||||||
|
|
||||||
|
def test_temp_data_dir(temp_data_dir):
|
||||||
|
print(temp_data_dir)
|
||||||
|
testpath = temp_data_dir / "__test"
|
||||||
|
with open(testpath, "w") as f:
|
||||||
|
f.write("that dir actually works")
|
||||||
|
os.remove(testpath)
|
||||||
|
assert not os.path.exists(testpath)
|
||||||
|
|
||||||
|
|
||||||
def test_save_and_load_any(store_manager: StoreManager):
|
def test_save_and_load_any(store_manager: StoreManager):
|
||||||
thing = {
|
thing = {
|
||||||
"color": "blue",
|
"color": "blue",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue