@@ -30,7 +30,7 @@ def test_get_migration_target_no_migration_image_found(
3030 mock_os_path_isfile .return_value = False
3131 assert MigrationTarget .get_migration_target () == {
3232 'identifier' : 'SLES' ,
33- 'version' : '15.4 ' ,
33+ 'version' : '15.7 ' ,
3434 'arch' : 'x86_64' ,
3535 }
3636
@@ -49,10 +49,52 @@ def test_get_migration_target_sles15(
4949 mock_os_path_isfile .return_value = False
5050 assert MigrationTarget .get_migration_target () == {
5151 'identifier' : 'SLES' ,
52+ 'version' : '15.7' ,
53+ 'arch' : 'x86_64' ,
54+ }
55+
56+ @patch ('platform.machine' )
57+ @patch ('os.path.isfile' )
58+ @patch ('suse_migration_services.migration_target.glob' )
59+ @patch ('suse_migration_services.migration_target.MigrationConfig' )
60+ def test_get_migration_target_sles_sap15 (
61+ self , mock_MigrationConfig , mock_glob , mock_os_path_isfile , mock_platform_machine
62+ ):
63+ migration_config = Mock ()
64+ migration_config .config_data = {}
65+ mock_MigrationConfig .return_value = migration_config
66+ mock_platform_machine .return_value = 'x86_64'
67+ mock_glob .return_value = [
68+ '/migration-image/SLES15-SAP_Migration.x86_64-2.1.9-Build6.64.99.iso'
69+ ]
70+ mock_os_path_isfile .return_value = False
71+ assert MigrationTarget .get_migration_target () == {
72+ 'identifier' : 'SLES_SAP' ,
5273 'version' : '15.4' ,
5374 'arch' : 'x86_64' ,
5475 }
5576
77+ @patch ('platform.machine' )
78+ @patch ('os.path.isfile' )
79+ @patch ('suse_migration_services.migration_target.glob' )
80+ @patch ('suse_migration_services.migration_target.MigrationConfig' )
81+ def test_get_migration_target_sles_sap16 (
82+ self , mock_MigrationConfig , mock_glob , mock_os_path_isfile , mock_platform_machine
83+ ):
84+ migration_config = Mock ()
85+ migration_config .config_data = {}
86+ mock_MigrationConfig .return_value = migration_config
87+ mock_platform_machine .return_value = 'x86_64'
88+ mock_glob .return_value = [
89+ '/migration-image/SLES16-SAP_Migration.x86_64-2.1.9-Build6.64.99.iso'
90+ ]
91+ mock_os_path_isfile .return_value = False
92+ assert MigrationTarget .get_migration_target () == {
93+ 'identifier' : 'SLES_SAP' ,
94+ 'version' : '16.0' ,
95+ 'arch' : 'x86_64' ,
96+ }
97+
5698 @patch ('platform.machine' )
5799 @patch ('os.path.isfile' )
58100 @patch ('suse_migration_services.migration_target.glob' )
0 commit comments