|
6 | 6 |
|
7 | 7 | def test_validate_bookstore_defaults():
|
8 | 8 | """Tests that all bookstore validates with default values."""
|
9 |
| - expected = {"bookstore_valid": False, "publish_valid": True, "archive_valid": True} |
| 9 | + expected = {"bookstore_valid": False, "publish_valid": False, "archive_valid": False} |
10 | 10 | settings = BookstoreSettings()
|
11 | 11 | assert validate_bookstore(settings) == expected
|
12 | 12 |
|
13 | 13 |
|
14 | 14 | def test_validate_bookstore_published():
|
15 | 15 | """Tests that bookstore does not validate with an empty published_prefix."""
|
16 |
| - expected = {"bookstore_valid": False, "publish_valid": False, "archive_valid": True} |
17 |
| - settings = BookstoreSettings(published_prefix="") |
| 16 | + expected = {"bookstore_valid": True, "publish_valid": False, "archive_valid": True} |
| 17 | + settings = BookstoreSettings(s3_bucket="A_bucket", published_prefix="") |
18 | 18 | assert validate_bookstore(settings) == expected
|
19 | 19 |
|
20 | 20 |
|
21 | 21 | def test_validate_bookstore_workspace():
|
22 | 22 | """Tests that bookstore does not validate with an empty workspace_prefix."""
|
23 |
| - expected = {"bookstore_valid": False, "publish_valid": True, "archive_valid": False} |
24 |
| - settings = BookstoreSettings(workspace_prefix="") |
| 23 | + expected = {"bookstore_valid": True, "publish_valid": True, "archive_valid": False} |
| 24 | + settings = BookstoreSettings(s3_bucket="A_bucket", workspace_prefix="") |
25 | 25 | assert validate_bookstore(settings) == expected
|
26 | 26 |
|
27 | 27 |
|
28 | 28 | def test_validate_bookstore_endpoint():
|
29 | 29 | """Tests that bookstore does not validate with an empty s3_endpoint_url."""
|
30 |
| - expected = {"bookstore_valid": False, "publish_valid": True, "archive_valid": True} |
| 30 | + expected = {"bookstore_valid": False, "publish_valid": False, "archive_valid": False} |
31 | 31 | settings = BookstoreSettings(s3_endpoint_url="")
|
32 | 32 | assert validate_bookstore(settings) == expected
|
33 | 33 |
|
34 | 34 |
|
35 | 35 | def test_validate_bookstore_bucket():
|
36 |
| - """Tests that bookstore does not validate with an empty s3_bucket.""" |
| 36 | + """Tests that all bookstore features validate with an s3_bucket.""" |
37 | 37 | expected = {"bookstore_valid": True, "publish_valid": True, "archive_valid": True}
|
38 | 38 | settings = BookstoreSettings(s3_bucket="A_bucket")
|
39 | 39 | assert validate_bookstore(settings) == expected
|
0 commit comments