Skip to content
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.

assert script (step5) need review #5

Open
ppKrauss opened this issue Aug 4, 2017 · 0 comments
Open

assert script (step5) need review #5

ppKrauss opened this issue Aug 4, 2017 · 0 comments
Labels

Comments

@ppKrauss
Copy link
Contributor

ppKrauss commented Aug 4, 2017

After sucesseful instation and population, some errors at assert, need only better casting, etc.

 tservice(N2C) 
---------------
--More--ERROR:  COALESCE types text and integer cannot be matched
LINE 11: ...element(  name ret,   COALESCE( issn.cast(issn.n2c($1)),0) )
                                                                    ^
QUERY:  SELECT CASE
    -- need XML convertion WHEN cmd='info' AND $1 IS NOT NULL AND $1::text>'' THEN issn.info($1)
    -- ... WHEN cmd='info' THEN issn.info()
    WHEN cmd='isc-int' OR cmd='isc' THEN
      xmlelement(  name ret,  COALESCE( issn.isc($1)::text,'') )
    WHEN cmd='isn-int' OR cmd='isn' THEN
      xmlelement(  name ret,  COALESCE( issn.isn($1)::text,'') )
    WHEN cmd='n2c-int' THEN
      xmlelement(  name ret,   COALESCE( issn.n2c($1),0) )
    WHEN cmd='n2c' THEN
      xmlelement(  name ret,   COALESCE( issn.cast(issn.n2c($1)),0) )
    WHEN cmd='n2ns-int' OR cmd='n2ns' THEN (
      SELECT xmlelement(  name ret,  xmlagg( xmlelement(name issn,COALESCE(i,'')) )  )
      FROM  ( -- need check when null
        SELECT unnest( CASE WHEN cmd='n2ns-int' THEN issn.n2ns($1)::text[] ELSE issn.n2ns_formated($1) END )
      ) t(i)
     )
    ELSE (text '<_ERROR_/>')::xml
  END
CONTEXT:  PL/pgSQL function issn.xservice_jspack(integer,text,integer,text) line 7 at assignment
....
 OK: n2c(int).
(1 row)
DELETE 0
INSERT 0 9

----- api.assert_tests, complete suite -----

   categ   |                                                                 result                                                            
     
-----------+-----------------------------------------------------------------------------------------------------------------------------------
-----
 issn-n2ns | ASSERT FAILED (issn/67/n2c)                                                                                                       
    +
           | ASSERT IS_EQUAL FAILED.                                                                                                           
    +
           |                                                                                                                                   
    +
           | Have -> {"result": "0000-1155", "status": 200, "outFormat": "json"}                                                               
    +
           | Want -> {"status" : 200, "result" : "0000-1155"}                                                                                  
    +
           | 
 issn-n2ns | ASSERT FAILED (issn/int/1/n2ns)                                                                                                   
    +
           | ASSERT IS_EQUAL FAILED.                                                                                                           
    +
           |                                                                                                                                   
    +
           | Have -> {"result": [1, 2150400], "status": 200, "outFormat": "json"}                                                              
    +
           | Want -> {"status" : 200, "result" : [1,2150400]}                                                                                  
    +
           | 
@ppKrauss ppKrauss added the bug label Aug 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant