Skip to content

Commit

Permalink
print statements for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
vliu36 committed Jul 29, 2024
1 parent 6a82b1c commit 5d53b42
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion controller/src/mongodb/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
def getColor(uuid: str) -> str:
""" Getter for color state in the DB. Stdout when method is instantiated and the values."""
response = lumongo.findOne({"uuid": uuid}, {"color": 1})
color = response.json()["document"]["color"] if not None else "NONE"
print("Response", response)
print()
color = response.json()["document"]["color"]
print("Color: ", color)
print(f"INFO | GET | COLOR: {color}")
return color

Expand All @@ -12,6 +15,7 @@ def setColor(uuid: str, value: str):
if len(value) == 7:
print(f"INFO | SET | COLOR: {value}")
response = lumongo.updateOne({"uuid": uuid}, {'$set': {'color': value}})
print("Response:", response)

else:
print(f"ERROR | SET | COLOR: {value} is not a valid color value!")
Expand Down

0 comments on commit 5d53b42

Please sign in to comment.