Exemplo n.º 1
0
    def test_destiny_cli_main_fetch_last_play_time(self, mock_pyguardian,
                                                   mock_stdout):
        destiny_cli.main(["ernie", "playstation", "last"])

        mock_pyguardian.assert_called_once()
        self.assertEqual(mock_stdout.getvalue().strip(),
                         "│ Character │ Datetime │ Session │")
Exemplo n.º 2
0
    def test_destiny_cli_main_fetch_stats(self, mock_pyguardian, mock_stdout):
        destiny_cli.main(["ernie", "pc", "stats"])

        mock_pyguardian.assert_called_once()
        self.assertEqual(
            mock_stdout.getvalue().strip(),
            "│ Character │ Power │ Mobility │  Resilience │ Recovery │  Level │"
        )
Exemplo n.º 3
0
    def test_destiny_cli_main_fetch_vault_sort_tier(self, mock_pyguardian,
                                                    mock_stdout):
        destiny_cli.main(["ernie", "playstation", "vault-tier"])

        mock_pyguardian.assert_called_once_with("ernie",
                                                "playstation",
                                                sort="tier")
        self.assertEqual(mock_stdout.getvalue().strip(),
                         "│ Item Name │ Item Type │ Item Tier │")
Exemplo n.º 4
0
#!/usr/bin/env python3.7
import sys
from pyguardian.main import destiny_cli


if __name__ == "__main__":
    destiny_cli.main(sys.argv[1:])
Exemplo n.º 5
0
    def test_destiny_cli_main_fetch_eq(self, mock_pyguardian, mock_stdout):
        destiny_cli.main(["ernie", "playstation", "eq"])

        mock_pyguardian.assert_called_once()
        self.assertEqual(mock_stdout.getvalue().strip(),
                         "│ MALE │ EXO │ WARLOCK │")
Exemplo n.º 6
0
 def test_destiny_cli_logging_not_enabled_if_logging_argument_not_passed(
         self, mock_log):
     destiny_cli.main([])
     mock_log.assert_called_once_with(level=50)
Exemplo n.º 7
0
 def test_destiny_cli_logging_re_enabled_if_logging_argument_passed(
         self, mock_log):
     destiny_cli.main(["--log"])
     mock_log.assert_has_calls([mock.call(0)])
Exemplo n.º 8
0
 def test_destiny_cli_download_manifest_not_required(
         self, mock_get_manifest, mock_check_manifest):
     destiny_cli.main(["-d"])
     mock_check_manifest.assert_called_once()
     mock_get_manifest.assert_not_called()