TestClient tests if reading from, writing to and deleting from the store works properly. A struct is used as value. See TestTypes() for a test that is simpler but tests all types. Note: This test is only executed if the initial connection to S3 works.
(t *testing.T)
| 34 | // |
| 35 | // Note: This test is only executed if the initial connection to S3 works. |
| 36 | func TestClient(t *testing.T) { |
| 37 | if !checkConnection() { |
| 38 | t.Skip("No connection to S3 could be established. Probably not running in a proper test environment.") |
| 39 | } |
| 40 | |
| 41 | // Test with JSON |
| 42 | t.Run("JSON", func(t *testing.T) { |
| 43 | client := createClient(t, encoding.JSON) |
| 44 | test.TestStore(client, t) |
| 45 | }) |
| 46 | |
| 47 | // Test with gob |
| 48 | t.Run("gob", func(t *testing.T) { |
| 49 | client := createClient(t, encoding.Gob) |
| 50 | test.TestStore(client, t) |
| 51 | }) |
| 52 | } |
| 53 | |
| 54 | // TestTypes tests if setting and getting values works with all Go types. |
| 55 | // |
nothing calls this directly
no test coverage detected