refactor(packagemanager,cli,tui): move packages in specific subfolders
This commit is contained in:
parent
11b8541630
commit
e49138fdd2
34 changed files with 18 additions and 18 deletions
44
pkg/packagemanager/os_test.go
Normal file
44
pkg/packagemanager/os_test.go
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
package packagemanager
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestNewOSManager(t *testing.T) {
|
||||
sudoPassword := "testpassword"
|
||||
|
||||
manager := NewOSManager(sudoPassword)
|
||||
|
||||
if manager.OS == nil {
|
||||
t.Error("Expected OS to be non-nil")
|
||||
}
|
||||
if manager.SudoPassword != sudoPassword {
|
||||
t.Errorf("Expected SudoPassword to be %s, got %s", sudoPassword, manager.SudoPassword)
|
||||
}
|
||||
}
|
||||
|
||||
func TestOSManagerName(t *testing.T) {
|
||||
manager := &OSManager{}
|
||||
if manager.Name() != "OS Package Manager" {
|
||||
t.Errorf("Expected name to be 'OS Package Manager', got %s", manager.Name())
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseOsRelease(t *testing.T) {
|
||||
osReleaseContent := `
|
||||
ID=ubuntu
|
||||
NAME="Ubuntu"
|
||||
VERSION_ID="20.04"
|
||||
`
|
||||
os := parseOsRelease(osReleaseContent)
|
||||
|
||||
if os.ID != "ubuntu" {
|
||||
t.Errorf("Expected ID to be 'ubuntu', got %s", os.ID)
|
||||
}
|
||||
if os.Name != "Ubuntu" {
|
||||
t.Errorf("Expected Name to be 'Ubuntu', got %s", os.Name)
|
||||
}
|
||||
if os.Version != "20.04" {
|
||||
t.Errorf("Expected Version to be '20.04', got %s", os.Version)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue