def test_GetCompleter_RAFromUserOption(self, *args): user_options = user_options_store.GetAll().copy( rust_toolchain_root='rust-analyzer') assert_that( GetCompleter(user_options)._rust_root, equal_to('rust-analyzer')) expected = os.path.join('rust-analyzer', 'bin', 'rust-analyzer') assert_that(GetCompleter(user_options)._ra_path, equal_to(expected))
def GetCompleter_RlsNotFound_test(*args): ok_(not GetCompleter(user_options_store.GetAll()))
def GetCompleter_RlsFound_test(): ok_(GetCompleter(user_options_store.GetAll()))
def GetCompleter_RlsFound_test(): assert_that(GetCompleter(user_options_store.GetAll()))
def test_GetCompleter_WarnsAboutOldConfig(self, logger): user_options = user_options_store.GetAll().copy( rls_binary_path='/does/not/exist') GetCompleter(user_options) logger.warning.assert_called_with( 'rls_binary_path detected. Did you mean rust_toolchain_root?')
def test_GetCompleter_InvalidRustRootFromUser(self, *args): user_options = user_options_store.GetAll().copy( rust_toolchain_root='/does/not/exist') assert_that(not GetCompleter(user_options))
def test_GetCompleter_RANotFound(self, *args): assert_that(not GetCompleter(user_options_store.GetAll()))
def test_GetCompleter_RAFound(self): assert_that(GetCompleter(user_options_store.GetAll()))
def GetCompleter_RANotFound_test(*args): assert_that(not GetCompleter(user_options_store.GetAll()))
def GetCompleter_RustcNotDefine_test(*args): user_options = user_options_store.GetAll().copy(rls_binary_path='rls') ok_(not GetCompleter(user_options))
def GetCompleter_RlsFromUserOption_test(*args): user_options = user_options_store.GetAll().copy(rls_binary_path='rls') user_options = user_options.copy(rustc_binary_path='rustc') eq_('rls', GetCompleter(user_options)._rls_binary_path) eq_('rustc', GetCompleter(user_options)._rustc_binary_path)
def GetCompleter_RlsFromUserOption_test(*args): user_options = user_options_store.GetAll().copy(rls_binary_path='rls') user_options = user_options.copy(rustc_binary_path='rustc') assert_that(GetCompleter(user_options)._rls_path, equal_to('rls')) assert_that(GetCompleter(user_options)._rustc_path, equal_to('rustc'))