Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh committed Jun 14, 2024
1 parent 1a7c61f commit 0d62c44
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions tests/client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
from flaky import flaky

from beaker import Beaker
from beaker.config import InternalConfig


@flaky # this can fail if the request to GitHub fails
def test_warn_for_newer_version(monkeypatch):
import beaker.client
import beaker.version

InternalConfig().save()

monkeypatch.setattr(Beaker, "CLIENT_VERSION", "0.1.0")
monkeypatch.setattr(beaker.client, "_LATEST_VERSION_CHECKED", False)

Expand Down
10 changes: 8 additions & 2 deletions tests/data_model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,16 @@ def test_experiment_spec_validation():

def test_snake_case_vs_lower_camel_case():
for x in (DataSource(host_path="/tmp/foo"), DataSource(hostPath="/tmp/foo")): # type: ignore
assert str(x) == "DataSource(beaker=None, host_path='/tmp/foo', result=None, secret=None)"
assert (
str(x)
== "DataSource(beaker=None, host_path='/tmp/foo', weka=None, result=None, secret=None)"
)
assert x.host_path == "/tmp/foo"
x.host_path = "/tmp/bar"
assert str(x) == "DataSource(beaker=None, host_path='/tmp/bar', result=None, secret=None)"
assert (
str(x)
== "DataSource(beaker=None, host_path='/tmp/bar', weka=None, result=None, secret=None)"
)
assert x.to_json() == {"hostPath": "/tmp/bar"}


Expand Down

0 comments on commit 0d62c44

Please sign in to comment.