Commit 42a45d1b authored by Alexandre Delanoë's avatar Alexandre Delanoë

[MOCK] pushing for the meeting and tests with the team.

parent b0712c53
...@@ -31,7 +31,9 @@ import GHC.Generics (Generic) ...@@ -31,7 +31,9 @@ import GHC.Generics (Generic)
import Data.Aeson hiding (Error) import Data.Aeson hiding (Error)
import Test.QuickCheck.Arbitrary import Test.QuickCheck.Arbitrary
import Test.QuickCheck (elements) import Test.QuickCheck (elements)
import Data.List (permutations) import Data.List (repeat, permutations)
-- import Control.Applicative ((<*>))
----------------------------------------------------------------------- -----------------------------------------------------------------------
type CountAPI = Post '[JSON] Counts type CountAPI = Post '[JSON] Counts
...@@ -71,6 +73,7 @@ data Query = Query { query_query :: QueryBool ...@@ -71,6 +73,7 @@ data Query = Query { query_query :: QueryBool
deriving (Eq, Show, Generic) deriving (Eq, Show, Generic)
instance FromJSON Query instance FromJSON Query
instance ToJSON Query instance ToJSON Query
instance Arbitrary Query where instance Arbitrary Query where
arbitrary = elements [ Query q (Just n) arbitrary = elements [ Query q (Just n)
| q <- queries | q <- queries
...@@ -95,7 +98,7 @@ messages = toMessage $ [ (400, ["Ill formed query "]) ...@@ -95,7 +98,7 @@ messages = toMessage $ [ (400, ["Ill formed query "])
, (300, ["Internal Gargantext Error "]) , (300, ["Internal Gargantext Error "])
, (300, ["Connexion to Gargantext Error"]) , (300, ["Connexion to Gargantext Error"])
, (300, ["Token has expired "]) , (300, ["Token has expired "])
] -- <> take 10 ( repeat (200, [""])) ] <> take 10 ( repeat (200, [""]))
instance Arbitrary Message where instance Arbitrary Message where
arbitrary = elements messages arbitrary = elements messages
...@@ -119,6 +122,10 @@ data Count = Count { count_name :: Scraper ...@@ -119,6 +122,10 @@ data Count = Count { count_name :: Scraper
instance FromJSON Count instance FromJSON Count
instance ToJSON Count instance ToJSON Count
--
--instance Arbitrary Count where
-- arbitrary = Count <$> arbitrary <*> arbitrary <*> arbitrary
instance Arbitrary Counts where instance Arbitrary Counts where
arbitrary = elements $ select arbitrary = elements $ select
......
...@@ -129,7 +129,6 @@ nodeNodeNgramLeftJoin' nId = leftJoin queryNodeTable queryNodeNodeNgramTable (eq ...@@ -129,7 +129,6 @@ nodeNodeNgramLeftJoin' nId = leftJoin queryNodeTable queryNodeNodeNgramTable (eq
((.==) nId' (toNullable n2)) ((.==) nId' (toNullable n2))
leftJoin3 :: (Default NullMaker (columnsL1, nullableColumnsR) nullableColumnsR1, leftJoin3 :: (Default NullMaker (columnsL1, nullableColumnsR) nullableColumnsR1,
Default NullMaker columnsR nullableColumnsR, Default NullMaker columnsR nullableColumnsR,
Default Unpackspec columnsR columnsR, Default Unpackspec columnsR columnsR,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment