Move xml tests to a separate module

This commit is contained in:
Krishnan Parthasarathi 2017-01-13 08:01:30 +05:30 committed by Aditya Manthramurthy
parent b9c7ceb435
commit 9aacd28f43
3 changed files with 18 additions and 10 deletions

View File

@ -119,6 +119,7 @@ test-suite minio-hs-test
, Network.Minio.Sign.V4
, Network.Minio.XmlGenerator
, Network.Minio.XmlParser
, XmlTests
source-repository head

View File

@ -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
View 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"