Skip to content

Commit

Permalink
fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
parmigggiana committed Oct 11, 2024
1 parent 97a0385 commit 3af1d0c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/peracotta/parsers/read_decode_dimms.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def parse_decode_dimms(dimms: str, interactive: bool = False) -> List[dict]:
for line in dimm.splitlines():
if line.startswith("Fundamental Memory type"):
dimms[i]["ram-type"] = line.split(" ")[-2].upper()
if dimms[i]["ram-type"] == "unknown":
if dimms[i]["ram-type"] == "UNKNOWN":
del dimms[i]["ram-type"]

if line.startswith("Maximum module speed"):
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def import_executable(name):

# def test_get_gpu(args): # checking that gpu_location is correctly read
# # checking mutual exclusion
# assert [args.cpu, args.gpu, args.motherboard].count(True) <= 1
# assert all([args.cpu, args.gpu, args.motherboard].count(True) <= 1


@pytest.fixture(params=test_folders)
Expand Down
6 changes: 3 additions & 3 deletions tests/parsers/test_alecase.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_lscpu():
def test_ram():
expect = [
{
"brand": "Micron Technology",
"brand": "Crucial Technology",
"capacity-byte": 8589934592,
"frequency-hertz": 1600000000,
"model": "CT102464BA160B.C16",
Expand All @@ -56,7 +56,7 @@ def test_ram():
"working": "yes",
},
{
"brand": "Micron Technology",
"brand": "Crucial Technology",
"capacity-byte": 8589934592,
"frequency-hertz": 1600000000,
"model": "CT102464BA160B.C16",
Expand All @@ -70,7 +70,7 @@ def test_ram():
]
output = read_decode_dimms.parse_decode_dimms(read_file(filedir, "dimms.txt"))
assert len(output) == 2, "2 RAM modules are found"
assert [d in expect for d in output], "The RAM modules are the expected ones"
assert all([d in expect for d in output]), "The RAM modules are the expected ones"


def test_baseboard():
Expand Down
2 changes: 1 addition & 1 deletion tests/parsers/test_asdpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_ram():
output = read_decode_dimms.parse_decode_dimms(read_file(filedir, "dimms.txt"))

assert len(output) == 2, "2 RAM modules are found"
assert [d in expect for d in output], "The RAM modules are the expected ones"
assert all([d in expect for d in output]), "The RAM modules are the expected ones"


def test_baseboard():
Expand Down
3 changes: 2 additions & 1 deletion tests/parsers/test_castes-pc.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def test_ram():
output = read_decode_dimms.parse_decode_dimms(read_file(filedir, "dimms.txt"))

assert len(output) == 2, "2 RAM modules are found"
assert [d in expect for d in output], "The RAM modules are the expected ones"
print(output)
assert all([d in expect for d in output]), "The RAM modules are the expected ones"


def test_baseboard():
Expand Down
2 changes: 1 addition & 1 deletion tests/parsers/test_dimms.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_ecc_ram1():
output = read_decode_dimms.parse_decode_dimms(read_file(filedir, "ECC/R451-R450.txt"))

assert len(output) == 2, "There are two RAM modules"
assert [d in expect for d in output], "The RAM modules are the expected ones"
assert all([d in expect for d in output]), "The RAM modules are the expected ones"


def test_ecc_ram1_not_an_hex():
Expand Down

0 comments on commit 3af1d0c

Please sign in to comment.