test

Tools for testing pyaptly

pyaptly.test.clean_and_config(test_input, freeze='2012-10-10 10:10:10')[source]

Remove aptly file and create a input config file to run pyaptly with.

Test input should be minimal and extended/tranformed in create_config.

Parameters:
  • test_input (str) – Path to test data input file
  • freeze – ISO8601 date string used to set the date/time for the test
  • freeze – str
Return type:

(dict, str)

pyaptly.test.create_config(test_input)[source]

Returns path to pyaptly config from test input.

Test input should be minimal and extended/tranformed in create_config.

Parameters:test_input (dict) – Test input read from test-yml.
Return type:(dict, str)
pyaptly.test.execute_and_parse_show_cmd(args)[source]

Executes and parses a aptly show command.

Parameters:args (list) – Command to execute
pyaptly.test.merge(a, b)[source]

Merge two dicts.

Parameters:
  • a (dict) – dict a
  • b (dict) – dict b
Return type:

dict

pyaptly.test.read_yml(file_)[source]

Read and merge a yml file.

Parameters:file (str) – file to read