Merge pull request #3487 from TranceLove/hotfix/3.8.1

Fix failing Espresso tests
This commit is contained in:
Vishal Nehra
2022-09-20 15:19:30 +05:30
committed by GitHub
3 changed files with 9 additions and 7 deletions
@@ -137,6 +137,6 @@ public class UtilsHandlerTest {
assertEquals(encryptedPath, result.get(0)[1]);
assertEquals(
"00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff",
utilsHandler.getSshHostKey(encryptedPath));
utilsHandler.getRemoteHostKey(encryptedPath));
}
}
@@ -30,6 +30,7 @@ import com.amaze.filemanager.BuildConfig;
import com.amaze.filemanager.utils.PasswordUtil;
import android.content.Context;
import android.util.Base64;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
@@ -52,7 +53,8 @@ public class CryptUtilTest {
@Test
public void testEncryptDecrypt() throws Exception {
String password = "hackme";
String encrypted = PasswordUtil.INSTANCE.encryptPassword(context, password);
assertEquals(password, PasswordUtil.INSTANCE.decryptPassword(context, encrypted));
String encrypted = PasswordUtil.INSTANCE.encryptPassword(context, password, Base64.URL_SAFE);
assertEquals(
password, PasswordUtil.INSTANCE.decryptPassword(context, encrypted, Base64.URL_SAFE));
}
}
@@ -46,7 +46,7 @@ public class SshClientUtilTest {
String result = NetCopyClientUtils.INSTANCE.encryptFtpPathAsNecessary(uri);
assertTrue(result.contains("ssh://testuser:"));
assertTrue(result.contains("@127.0.0.1:22"));
String verify = NetCopyClientUtils.INSTANCE.encryptFtpPathAsNecessary(result);
String verify = NetCopyClientUtils.INSTANCE.decryptFtpPathAsNecessary(result);
assertEquals(uri, verify);
}
@@ -56,7 +56,7 @@ public class SshClientUtilTest {
String result = NetCopyClientUtils.INSTANCE.encryptFtpPathAsNecessary(uri);
assertTrue(result.contains("ssh://testuser:"));
assertTrue(result.contains("@127.0.0.1:22"));
String verify = NetCopyClientUtils.INSTANCE.encryptFtpPathAsNecessary(result);
String verify = NetCopyClientUtils.INSTANCE.decryptFtpPathAsNecessary(result);
assertEquals(uri, verify);
}
@@ -66,7 +66,7 @@ public class SshClientUtilTest {
String result = NetCopyClientUtils.INSTANCE.encryptFtpPathAsNecessary(uri);
assertTrue(result.contains("ssh://testuser:"));
assertTrue(result.contains("@127.0.0.1:22"));
String verify = NetCopyClientUtils.INSTANCE.encryptFtpPathAsNecessary(result);
String verify = NetCopyClientUtils.INSTANCE.decryptFtpPathAsNecessary(result);
assertEquals(uri, verify);
}
@@ -76,7 +76,7 @@ public class SshClientUtilTest {
String result = NetCopyClientUtils.INSTANCE.encryptFtpPathAsNecessary(uri);
assertTrue(result.contains("ssh://testuser:"));
assertTrue(result.contains("@127.0.0.1:22"));
String verify = NetCopyClientUtils.INSTANCE.encryptFtpPathAsNecessary(result);
String verify = NetCopyClientUtils.INSTANCE.decryptFtpPathAsNecessary(result);
assertEquals(uri, verify);
}
}