Move xml tests to a separate module
This commit is contained in:
parent
b9c7ceb435
commit
9aacd28f43
@ -119,6 +119,7 @@ test-suite minio-hs-test
|
||||
, Network.Minio.Sign.V4
|
||||
, Network.Minio.XmlGenerator
|
||||
, Network.Minio.XmlParser
|
||||
, XmlTests
|
||||
|
||||
|
||||
source-repository head
|
||||
|
||||
11
test/Spec.hs
11
test/Spec.hs
@ -6,7 +6,7 @@ import Test.Tasty.HUnit
|
||||
import Control.Monad.Trans.Resource (runResourceT)
|
||||
|
||||
import Network.Minio
|
||||
import Network.Minio.XmlGenerator
|
||||
import XmlTests
|
||||
|
||||
main :: IO ()
|
||||
main = defaultMain tests
|
||||
@ -53,12 +53,3 @@ unitTests = testGroup "Unit tests"
|
||||
|
||||
, testCase "Test mkCreateBucketConfig." testMkCreateBucketConfig
|
||||
]
|
||||
|
||||
usEastBucketConfig :: ByteString
|
||||
usEastBucketConfig = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><CreateBucketConfiguration xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\">\
|
||||
\<LocationConstraint>EU</LocationConstraint>\
|
||||
\</CreateBucketConfiguration>"
|
||||
|
||||
testMkCreateBucketConfig :: Assertion
|
||||
testMkCreateBucketConfig = do
|
||||
assertEqual "CreateBucketConfiguration xml should match: " usEastBucketConfig $ mkCreateBucketConfig "EU"
|
||||
|
||||
16
test/XmlTests.hs
Normal file
16
test/XmlTests.hs
Normal file
@ -0,0 +1,16 @@
|
||||
module XmlTests where
|
||||
|
||||
import Protolude
|
||||
|
||||
import Test.Tasty.HUnit
|
||||
|
||||
import Network.Minio.XmlGenerator
|
||||
|
||||
euBucketConfig :: ByteString
|
||||
euBucketConfig = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><CreateBucketConfiguration xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\">\
|
||||
\<LocationConstraint>EU</LocationConstraint>\
|
||||
\</CreateBucketConfiguration>"
|
||||
|
||||
testMkCreateBucketConfig :: Assertion
|
||||
testMkCreateBucketConfig = do
|
||||
assertEqual "CreateBucketConfiguration xml should match: " euBucketConfig $ mkCreateBucketConfig "EU"
|
||||
Loading…
Reference in New Issue
Block a user