File tree 1 file changed +26
-0
lines changed
readthedocs/rtd_tests/tests
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -919,6 +919,32 @@ def test_is_obsolete_with_json_different_build_image(self):
919
919
exists .return_value = True
920
920
self .assertTrue (python_env .is_obsolete )
921
921
922
+ def test_is_obsolete_with_project_different_build_image (self ):
923
+ config_data = {
924
+ 'build' : {
925
+ 'image' : '2.0' ,
926
+ },
927
+ 'python' : {
928
+ 'version' : 2.7 ,
929
+ },
930
+ }
931
+ yaml_config = create_load (config_data )()[0 ]
932
+ config = ConfigWrapper (version = self .version , yaml_config = yaml_config )
933
+
934
+ # Set container_image manually
935
+ self .pip .container_image = 'readthedocs/build:latest'
936
+ self .pip .save ()
937
+
938
+ python_env = Virtualenv (
939
+ version = self .version ,
940
+ build_env = None ,
941
+ config = config ,
942
+ )
943
+ env_json_data = '{"build": {"image": "readthedocs/build:2.0"}, "python": {"version": 2.7}}'
944
+ with patch ('os.path.exists' ) as exists , patch ('readthedocs.doc_builder.python_environments.open' , mock_open (read_data = env_json_data )) as _open : # noqa
945
+ exists .return_value = True
946
+ self .assertTrue (python_env .is_obsolete )
947
+
922
948
def test_is_obsolete_with_json_same_data_as_version (self ):
923
949
config_data = {
924
950
'build' : {
You can’t perform that action at this time.
0 commit comments