Build a User Configuration Manager - Build a User Configuration Manager

Tell us what’s happening:

Can someone please help me out as to why doesn’t the system accept that my key and value is getting converted to lower case?

My output is ‘bluetooth’ and ‘false’ but somehow step 4 does not accept that my key and value are getting to lower case

Your code so far

test_settings = {
    'Notifications' : 'disabled',
    'Theme' : 'Light',
    'Volume' : 'Low',
    'Volume' : 50,
    'Brightness' : 30
}

def add_setting (settings, pair):
    key, value = pair
    key = str(key).lower()
    value = str(value).lower()
    print (key)
    print (value)

add_setting(test_settings, ('Bluetooth', False))

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36

Challenge Information:

Build a User Configuration Manager - Build a User Configuration Manager

Your code is fine, the test error will go away after you add the new lowercase key,value pairs to settings, focus on the next instructions and this one will work.

1 Like

In my opinion this should be considered a bug because i have been writing and re writing these lines of code for over 24 hours on and off at this point getting more and more frustrated as Ive gone on. The devs need to put the tests in the order that they will be tested. Im no expert at all on how theyve made the test program on the back end and if there is some fundamental reason I do not understand here but I am beyond aggrivated at this moment. Why even have the tests marked down for the user to see in an ordered list if the order is completely irrelevant to how and if the code you have written will pass. I want to take my head and put it into a wall right now.

the tests can test only what the function return or what it affects on the outside, at this time your function is not returning nor changing settings so the tests don’t see anything yet

1 Like

—begin rant:
And in my opinion, it is presumptuous to expect the tests to give you feedback for each line of code you write. The tests were designed to be used AFTER all user stories have been implemented. They were not designed to let users know if every line of code they write is correct. Do you think there is going to be a constant feedback mechanism in place like that when you’re on the job? Do the work. Implement all of the user stories. Use the tests provided in each lab to check your code yourself with function calls inside print statements. Then run the tests. It’s possible a test may fail when another issue is in the way and you will need to step through your code to debug it yourself. That’s what this is all about…learning how to code…by yourself. Learning how to test your own code. And learning how to debug your code when it fails.
—end rant.

1 Like

Hey i wasn’t trying to get you riled up also no need in two people being aggravated. I was just stating my feelings on the matter. Like i said I’m no expert I have no idea how this stuff works on the back end as far as how the tests have been designed. I think that maybe the feedback for the test portion should be removed and only resolve after you have completed the user story then maybe show the tests, present the user with what did not pass and then put the user back in the code development environment. You already have it set up to be able to snapshot the users inputs. It’s just an idea maybe a bad one but an idea none the less. As far as my understanding went the testing blocks had to be completed in order and the user story was just another way to give the test a verbal expression element similar to math classes back in school where you would sometimes get the numerical equation to solve and sometimes they would present the equation as a word problem. My bad, sorry if i made you upset. I can see how I maybe came off as pretentious and that was not my intent. I was just frustrated is all. I hope you have a good week, Happy Monday.

the thing with having tests that give feedback based on exactly what you have written before the function has an output is that the function can be implemented in an infinite number of ways, while the tests would not be able to accomodate that

to allow the code to be written in this unlimited number of ways, the tests are checking the output or side effects

1 Like

Of course, sorry for my fundamental misunderstanding here and I did not mean to ruffle any feathers here at FreeCodeCamp. I am appreciative of what you guys do and impressed with how fleshed out this educational suite has been and look forward to continuing down this path that the team here has paved for me to expand my knowledge and potential job prospects. All the best to the team here. No hard feelings. Sorry if i came off arrogant.

No worries, It is understandable to want feedback like that, we are not able to write tests that do that tho. maybe in the future…

1 Like