nix: Add weeder to postgrest-coverage

Removes a bit of dead code from SpecHelper.hs
This commit is contained in:
Wolfgang Walther
2022-06-03 22:19:16 -05:00
committed by Steve Chavez
parent 9b397878dc
commit 7940e73a12
5 changed files with 14 additions and 16 deletions
+1 -12
View File
@@ -1,6 +1,6 @@
module SpecHelper where
import qualified Data.ByteString.Base64 as B64 (decodeLenient, encode)
import qualified Data.ByteString.Base64 as B64 (decodeLenient)
import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.Lazy as BL
import qualified Data.Map.Strict as M
@@ -189,17 +189,10 @@ testMultipleSchemaCfg testDbConn = (testCfg testDbConn) { configDbSchemas = from
testCfgLegacyGucs :: Text -> AppConfig
testCfgLegacyGucs testDbConn = (testCfg testDbConn) { configDbUseLegacyGucs = False }
resetDb :: Text -> IO ()
resetDb dbConn = loadFixture dbConn "data"
analyzeTable :: Text -> Text -> IO ()
analyzeTable dbConn tableName =
void $ readProcess "psql" ["--set", "ON_ERROR_STOP=1", toS dbConn, "-a", "-c", toS $ "ANALYZE test.\"" <> tableName <> "\""] []
loadFixture :: Text -> FilePath -> IO()
loadFixture dbConn name =
void $ readProcess "psql" ["--set", "ON_ERROR_STOP=1", toS dbConn, "-q", "-f", "test/fixtures/" ++ name ++ ".sql"] []
rangeHdrs :: ByteRange -> [Header]
rangeHdrs r = [rangeUnit, (hRange, renderByteRange r)]
@@ -226,10 +219,6 @@ authHeader :: BS.ByteString -> BS.ByteString -> Header
authHeader typ creds =
(hAuthorization, typ <> " " <> creds)
authHeaderBasic :: BS.ByteString -> BS.ByteString -> Header
authHeaderBasic u p =
authHeader "Basic" $ toS . B64.encode . toS $ u <> ":" <> p
authHeaderJWT :: BS.ByteString -> Header
authHeaderJWT = authHeader "Bearer"