Skip to content

Commit e7c5ed4

Browse files
committed
Don't run tests that require an SD card when it's not present
The feature this tests verifies requires an SD card and will fail if it's not available.
1 parent 762f8f6 commit e7c5ed4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

androidTest/java/org/aprsdroid/app/ProfileTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
import static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction;
77
import static androidx.test.espresso.matcher.ViewMatchers.withText;
88
import static org.hamcrest.Matchers.allOf;
9+
import static org.junit.Assume.assumeTrue;
910

1011
import android.app.Instrumentation;
1112
import android.content.Intent;
13+
import android.os.Environment;
1214

1315
import androidx.test.core.app.ActivityScenario;
1416
import androidx.test.espresso.intent.Intents;
@@ -34,6 +36,7 @@ public void tearDown() {
3436

3537
@Test
3638
public void testThatExportProfileOpensTheChooser() {
39+
assumeTrue(Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()));
3740
ActivityScenario scenario = ActivityScenario.launch(PrefsAct.class);
3841
Intents.intending(hasAction(Intent.ACTION_CHOOSER)).respondWith(new Instrumentation.ActivityResult(0, null));
3942
openActionBarOverflowOrOptionsMenu(InstrumentationRegistry.getInstrumentation().getTargetContext());

0 commit comments

Comments
 (0)