-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Move tests under test directory
- Loading branch information
1 parent
a0e0e41
commit 0602b5c
Showing
1 changed file
with
11 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,49 @@ | ||
util = import_module("./util.star") | ||
util = import_module("/src/util.star") | ||
|
||
def test_label_from_image_short_image_name(plan): | ||
image_name = "my-image" | ||
image_label = util.label_from_image(image_name) | ||
|
||
assert.eq(image_name, image_label) | ||
expect.eq(image_name, image_label) | ||
|
||
def test_label_from_image_63_character_image_name(plan): | ||
image_name = ("tenletters" * 6) + "333" | ||
assert.eq(len(image_name), 63) | ||
expect.eq(len(image_name), 63) | ||
|
||
image_label = util.label_from_image(image_name) | ||
assert.eq(image_name, image_label) | ||
expect.eq(image_name, image_label) | ||
|
||
def test_label_from_image_64_character_image_name_no_slashes(plan): | ||
image_name = ("tenletters" * 6) + "4444" | ||
assert.eq(len(image_name), 64) | ||
expect.eq(len(image_name), 64) | ||
|
||
image_label = util.label_from_image(image_name) | ||
assert.eq(image_name[-63:], image_label) | ||
expect.eq(image_name[-63:], image_label) | ||
|
||
def test_label_from_image_long_image_name_no_slashes(plan): | ||
image_name = "tenletters" * 10 | ||
assert.eq(len(image_name), 100) | ||
expect.eq(len(image_name), 100) | ||
|
||
image_label = util.label_from_image(image_name) | ||
assert.eq(image_name[-63:], image_label) | ||
expect.eq(image_name[-63:], image_label) | ||
|
||
def test_label_from_image_long_image_name_one_slash(plan): | ||
image_suffix = "444" | ||
image_name = "/".join(("tenletters" * 6, image_suffix)) | ||
|
||
image_label = util.label_from_image(image_name) | ||
assert.eq(image_suffix, image_label) | ||
expect.eq(image_suffix, image_label) | ||
|
||
def test_label_from_image_long_image_name_more_slashes(plan): | ||
image_suffix = "/".join(("slash", "slash2", "slash3")) | ||
image_name = "/".join(("tenletters" * 8, image_suffix)) | ||
|
||
image_label = util.label_from_image(image_name) | ||
assert.eq(image_suffix, image_label) | ||
expect.eq(image_suffix, image_label) | ||
|
||
def test_label_from_image_long_image_name_long_suffix(plan): | ||
image_suffix = "/".join(("slash", "slash2", "slash3", "what-a-suffix" * 5)) | ||
image_name = "/".join(("tenletters" * 8, image_suffix)) | ||
|
||
image_label = util.label_from_image(image_name) | ||
assert.eq(image_suffix[-63:], image_label) | ||
expect.eq(image_suffix[-63:], image_label) |