Move common code to a helper file.
Add prefix test_ to test files.
Add tests for the update command.