Opened 9 years ago

Closed 9 years ago

#238 closed task (fixed)

tests for src/bin/cfgmgr/b10-cfgmgr.py

Reported by: jreed Owned by: jelte
Priority: low Milestone: 05. 3rd Incremental Release: Serious Secondary
Component: configuration Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity:
Sub-Project: Feature Depending on Ticket:
Estimated Difficulty: Add Hours to Ticket:
Total Hours: Internal?:

Description

need tests for src/bin/cfgmgr/b10-cfgmgr.py

Subtickets

Change History (5)

comment:1 follow-up: Changed 9 years ago by jelte

  • Owner changed from jelte to UnAssigned
  • Status changed from new to reviewing

Changes in branches/238

Had to do a bit of module import magic to get the code to run, and all the tests really do is check if the global variables are as expected and the needed functions are called (which is, coincidentally, also everything the script does :) )

comment:2 Changed 9 years ago by shane

  • Milestone set to 05. 3rd Incremental Release: Serious Secondary

comment:3 in reply to: ↑ 1 Changed 9 years ago by jinmei

Replying to jelte:

Changes in branches/238

Had to do a bit of module import magic to get the code to run, and all the tests really do is check if the global variables are as expected and the needed functions are called (which is, coincidentally, also everything the script does :) )

I basically have no objection to the patch.

Two minor nits:

  • typo: s/moculde/module/ (?)
    +        # moculde ConfigManager in it.
    
  • what's "aay"?
    +        # (and rename the .in aay from this file again)
    

And, not actually for the tests, but I wonder:

  • what if write_config() fails? (or can we assume it doesn't raise an exception?)
  • is it okay to do write_config() evn if the try block fails due to some unexpected exception? For example, isn't it possible it has incomplete data if read_conifg() fails?

I don't know if these are real issues, and even if so, they can (and probably should) go to a different ticket.

comment:4 Changed 9 years ago by jinmei

  • Owner changed from UnAssigned to jelte

comment:5 Changed 9 years ago by jelte

  • Resolution set to fixed
  • Status changed from reviewing to closed

If those are issues then they should be handled in cfgmgr, not here. Fixing typo's and merging (r2145).

Note: See TracTickets for help on using tickets.