Skip to content

Commit

Permalink
test: add cases for when file is valid-but-empty toml and has no `pac…
Browse files Browse the repository at this point in the history
…kage`s at all
  • Loading branch information
G-Rath committed Dec 3, 2024
1 parent 9d2b1a0 commit f9d6d49
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +0,0 @@
version = 1
requires-python = ">=3.10"

[[package]]
name = "uv-lockfiles"
version = "0.1.0"
source = { virtual = "." }
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version = 1
requires-python = ">=3.10"

[[package]]
name = "uv-lockfiles"
version = "0.1.0"
source = { virtual = "." }
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version = 1
requires-python = ">=3.10"
14 changes: 14 additions & 0 deletions extractor/filesystem/language/python/uvlock/uvlock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,20 @@ func TestExtractor_Extract(t *testing.T) {
WantErr: extracttest.ContainsErrStr{Str: "could not extract from"},
WantInventory: []*extractor.Inventory{},
},
{
Name: "empty file",
InputConfig: extracttest.ScanInputMockConfig{
Path: "testdata/empty.lock",
},
WantInventory: []*extractor.Inventory{},
},
{
Name: "no dependencies",
InputConfig: extracttest.ScanInputMockConfig{
Path: "testdata/empty.lock",
},
WantInventory: []*extractor.Inventory{},
},
{
Name: "no packages",
InputConfig: extracttest.ScanInputMockConfig{
Expand Down

0 comments on commit f9d6d49

Please sign in to comment.